필터 지우기
필터 지우기

Many legend on a figure

조회 수: 2 (최근 30일)
David Hastana
David Hastana 2020년 2월 26일
댓글: David Hastana 2020년 2월 26일
Hello ,
I would like to put 3 legend and 3 curves on the same figure, I tried this:
figure(1)%
plot(t,I(:,2),'b','linewidth',1.5);grid on
legend('ids');
xlabel('time[sec]');
ylabel('Courant ids');
hold on
plot(t,I(:,3),'r','linewidth',1.5);grid on
legend('iqs');
xlabel('time[sec]');
ylabel('Courant iqs');
hold on
plot(t,I(:,4),'g','linewidth',1.5);grid on
legend('if');
xlabel('time[sec]');
ylabel('Courant if');
but it does not work.
Do you have a solution ?
  댓글 수: 3
Jeremy
Jeremy 2020년 2월 26일
Why do you want separate legends though? You can have one legend statement at the end with all 3 linestyles described
David Hastana
David Hastana 2020년 2월 26일
for example, in the preceding example, I want to display id (blue line), iq (red line) and if (green line)
like iqk, i also want ids, iqs, if ...

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

답변 (1개)

Walter Roberson
Walter Roberson 2020년 2월 26일
Why should anyone answer this question when it is almost certain that you will attempt to get rid of the question afterwards?

카테고리

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