How to set legend for a line segment?
Ältere Kommentare anzeigen
How to add legend to this?: line([x1 x2],[y1,y2],'color','r','linestyle','--');
Antworten (1)
Thorsten
am 5 Nov. 2015
x1 = 10; x2 = 20; y1 = 12; y2 = 34;
line([x1 x2],[y1,y2],'color','r','linestyle','--');
legend('my dashed red line')
2 Kommentare
h = line([x1 x2],[y1,y2],'color','r','linestyle','--');
legend(h, 'my dashed red line')
If this does not the job, please post a minimal working example of what you try to do and what goes wrong.
Kategorien
Mehr zu Legend finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!