Legend does not refresh after hold command
조회 수: 4 (최근 30일)
이전 댓글 표시
Let'say I plot 2 lines and I want to display a legend
plot(1:10,'b','displayname','1st graph')
hold on
plot(3:5,'r','displayname','2ng graph')
legend('show')
It works as expected, I have a legend and 2 annotations.
Not let's say I also want to display the legend before the hold command (for any reason) :
plot(1:10,'b','displayname','1st graph')
legend('show')
hold on
plot(3:5,'r','displayname','2ng graph')
legend('show')
This time only the first annotation is displayed . I expected that recalling legend will refresh the legend information.
- Is it the expected behavior?
- What are the best practices to call legend ?
- Do we have to call legend ONCE and only after having plotted everything?
Thanks for your tips,
Aurélien
댓글 수: 0
채택된 답변
추가 답변 (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!