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 Center および File ExchangeAnnotations についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by