'Legend' Command shows wrong symbols (R2011b)
조회 수: 7 (최근 30일)
이전 댓글 표시
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
답변 (1개)
Razvan
2012년 2월 13일
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
참고 항목
카테고리
Help Center 및 File Exchange에서 Legend에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!