MATLAB two Graph Plotting

조회 수: 14 (최근 30일)
ANMOL BAKSHI
ANMOL BAKSHI 2020년 11월 9일
댓글: ANMOL BAKSHI 2020년 11월 9일
x = 1:100;
y = ones(1,100);
y1 = ones(1,100);
y2 = ones(1,100);
y3 = ones(1,100);
y = x;
y1 = x+2;
y2 = x+50;
y3 = x+100;
plot(x,y2,x,y3);
figure(1);
xlabel("x");
ylabel("y");
legend('y2,y3');
plot(x,y,x,y1);
figure(2);
xlabel("x");
ylabel("y");
legend1('y,y1');
When I am running figure(2) is coming blank. Why is it so?

채택된 답변

VBBV
VBBV 2020년 11월 9일
편집: VBBV 2020년 11월 9일
%if true
% code
% end
figure(1)
plot()
...
...
figure(2)
plot()
...
...
Follow this sequence for plotting. There is no legend1. Only legend
  댓글 수: 1
ANMOL BAKSHI
ANMOL BAKSHI 2020년 11월 9일
yes it worked, thanks a lot.

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

추가 답변 (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