'Legend' Command shows wrong symbols (R2011b)
8 views (last 30 days)
Show older comments
Hello all,
I have had issues recently when trying to display a legend on a figure. To my knowledge, the command is formatted as:
legend('Re = 2000','Re = 3000','Re = 4000','Re = 5000','Re = 6000',0)
The legend displays properly, but the symbols used for each data set are not displayed correctly. In this instance, the symbols should be 'o','x','+','s', and 'h'. The legend shows up with the symbols 'o','o','x','+', and 'o'.
0 Comments
Answers (1)
Razvan
on 13 Feb 2012
The symbols are set in the plot commands, not in the legend command.
Check this example:
M = rand(6, 20);
plot(M(1, :), '-o'); hold all
plot(M(2, :), '-x');
plot(M(3, :), '-+');
plot(M(4, :), '-s');
plot(M(5, :), '-h'); hold off
legend({'Re = 2000','Re = 3000','Re = 4000','Re = 5000','Re = 6000'})
I hope this helps.
Razvan
0 Comments
See Also
Categories
Find more on Legend in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!