Mostrar comentarios más antiguos
The code below
(i) does not produce an error message about not matching x and y; it can be explained by implicit expansion in plot();
(ii) produces 100 legends; this I cannot explain.
x=1:100;
y=1;
plot(x,y,'DisplayName','a bug'),
legend('-DynamicLegend'),
Respuesta aceptada
Más respuestas (1)
Bruno Luong
el 11 de Sept. de 2019
Editada: Bruno Luong
el 11 de Sept. de 2019
1 voto
No it's not a bug: from PLOT doc
- If one of X or Y is a scalar and the other is either a scalar or a vector, then the plot function plots discrete points. However, to see the points you must specify a marker symbol, for example, plot(X,Y,'o').
You get really 100 points plotted.
Categorías
Más información sobre Legend 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!