Is any change 'DisplayName' property in plot function?
Mostrar comentarios más antiguos
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 comentario
Baptiste Contour
el 26 de Jun. de 2020
Editada: Baptiste Contour
el 26 de Jun. de 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');
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Graphics Object Programming en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!