Get lineseries handle
Mostra commenti meno recenti
I'm trying to use set to set the display name of each legend label.
If I have:
h=plot();
Then try to do:
set(h(1),'DisplayName','data label')
It's not working. Do I have to set the legend to be displayed first or does this automatically display it then change the label of each data series?
Risposta accettata
Più risposte (1)
Fangjun Jiang
il 3 Nov 2011
If you want to change the legend, get the handle of the legend, or simply run legend() again.
plot(magic(3));
legend({'a','b','c'});
h=legend({'1','2','3'});
set(h,'string',{'first','second','third'});
Categorie
Scopri di più su Legend in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!