Is any change 'DisplayName' property in plot function?
Mostra commenti meno recenti
plot(x,y,'DisplayName',{'name1','name2','name3','name4'})
produce error
Error using plot
Value must be a string.
This shall produce this plot with curve names.

Is any change in 'DisplayName' property in plot function?
1 Commento
Baptiste Contour
il 26 Giu 2020
Modificato: Baptiste Contour
il 26 Giu 2020
Using 2020a
Names need to be a char:
plot(magic(4),'DisplayName',char({'name1','name2','name3','name4'}))
You still need to specify a minimum the legend afterwards to display it, eg:
legend('location', 'best');
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Graphics Object Programming 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!