Afficher commentaires plus anciens
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'),
Réponse acceptée
Plus de réponses (1)
Bruno Luong
le 11 Sep 2019
Modifié(e) : Bruno Luong
le 11 Sep 2019
1 vote
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.
Catégories
En savoir plus sur Legend 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!