legend doesn't appear on plot

1 回表示 (過去 30 日間)
talayeh ghodsi
talayeh ghodsi 2021 年 2 月 19 日
コメント済み: Walter Roberson 2021 年 2 月 19 日
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 件のコメント
talayeh ghodsi
talayeh ghodsi 2021 年 2 月 19 日
sorry but why inside the box in my plot is white and empty?
Walter Roberson
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 ExchangeLegend についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by