![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/524664/image.png)
legend doesn't appear on plot
조회 수: 3 (최근 30일)
이전 댓글 표시
hi every body. I want to plot a simple problem with a legend. but the legend box is empty on plot as the image i have attached
could anybody help me please
p1_visual=[2 9 28 29 38 50]
p1_method=[3 8 26 31 40 51]
p2_visual=[3 10 26 28 28 51]
p2_method=[3 9 25 31 32 51]
X = categorical({'P1','P2'});
X = reordercats(X,{'P1','P2'});
y_visual_ED=([p1_visual(1);p2_visual(1)]);
y_method_ED=([p1_method(1);p2_method(1)]);
figure (1)
plot(X,y_visual_ED,'b--o',X,y_method_ED,'r-*')
ylim([0 60])
xlabel('Patient')
ylabel('Frame Number')
title('End Diastole')
legend('Visual reading','Proposed method')
figure(2)
y_visual_Ra.E=([p1_visual(2);p2_visual(2);p3_visual(2);p4_visual(2);p5_visual(2);P6_visual(2);p7_visual(2);P8_visual(2);P9_visual(2);p10_visual(2)]);
y_method_Ra.E=([p1_method(2);p2_method(2);P3_method(2);p4_method(2);p5_method(2);P6_method(2);p7_method(2);P8_method(2);P9_method(2);p10_method(2)]);
plot(X,y_visual_Ra.E,'b--o',X,y_method_Ra.E,'r-*')
ylim([0 60])
xlabel('Patient')
ylabel('Frame Number')
title('Rapid Ejection')
legend('Visual reading','Proposed method')
댓글 수: 3
Walter Roberson
2021년 2월 19일
Which MATLAB version are you using, and which operating system? What is the output of
opengl info
and what shows up for
which legend
답변 (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!