plotting issue along the x-axis !

조회 수: 3 (최근 30일)
Ano
Ano 2017년 12월 9일
댓글: Star Strider 2017년 12월 11일
Hello ! I would like to plot two curves in the same figure, to make my issue more clear let consider the following example:
x = linspace(0,10,20);
y = x ;
y1 = x;
plot(x,y);hold on
plot(-x,y1) ;
I would like to get the same general aspect of the figure but with the second curve plotted along [10 0], any suggestions how can I get it done ?! Thank you!

채택된 답변

Star Strider
Star Strider 2017년 12월 9일
Use fliplr (or flip) on the x argument in the second plot call:
x = linspace(0,10,20);
y = x ;
y1 = x;
plot(x,y)
hold on
plot(fliplr(x),y1)
hold off
  댓글 수: 8
Ano
Ano 2017년 12월 11일
thank you very much !
Star Strider
Star Strider 2017년 12월 11일
As always, my pleasure!

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

추가 답변 (0개)

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by