Is any change 'DisplayName' property in plot function?
Ältere Kommentare anzeigen
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 Kommentar
Baptiste Contour
am 26 Jun. 2020
Bearbeitet: Baptiste Contour
am 26 Jun. 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');
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Graphics Object Programming 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!