'Legend' Command shows wrong symbols (R2011b)

8 views (last 30 days)
Christopher
Christopher on 13 Feb 2012
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'.

Answers (1)

Razvan
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

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!