필터 지우기
필터 지우기

Error in the chart legend

조회 수: 1 (최근 30일)
Adrian T
Adrian T 2019년 5월 7일
댓글: Adam Danz 2019년 5월 20일
Hello
Why do I have a bug in the legend?
Code:
for i=1:1:4
w1=subplot(1,2,1);hold on;
p(i)=plot( w1,TR,y,[znaki(i),rodzaj{i},kolor(i)]);
legend(w1,'w1 ','w2 ','w3','w4');
end
  댓글 수: 3
Adam Danz
Adam Danz 2019년 5월 7일
I'm assuming that the triple does produce the line specs shown in the first 4 legend elements.
Adam Danz
Adam Danz 2019년 5월 20일
It looks like additional plotting is done elsewhere in your code. Try this if you only want the first 4 objects in your legend.
w1=subplot(1,2,1);hold on;
for i=1:1:4
p(i)=plot( w1,TR,y,[znaki(i),rodzaj{i},kolor(i)]),'DisplayName', sprintf('w%d',i);
end
legend(p,'AutoUpdate ', 'off');

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Legend에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by