Filter löschen
Filter löschen

legend on a plot.

1 Ansicht (letzte 30 Tage)
Mate 2u
Mate 2u am 16 Jul. 2012
Hi All, I Plot a 250x10 matrix. But I only want the legend for the 3rd 5th and 9th element.
How can I do this?

Akzeptierte Antwort

Sean de Wolski
Sean de Wolski am 16 Jul. 2012
Use the handle explicitly:
h = plot(cumsum(rand(250,10)));
legend(h([3 5 9]),'third','fifth','ninth')
And for more info:
doc legend

Weitere Antworten (0)

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by