Is any change 'DisplayName' property in plot function?
Afficher commentaires plus anciens
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 commentaire
Baptiste Contour
le 26 Juin 2020
Modifié(e) : Baptiste Contour
le 26 Juin 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');
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Graphics Object Programming dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!