How to flip the data upside down without flipping the axes?

3 ビュー (過去 30 日間)
Kofial
Kofial 2021 年 1 月 18 日
コメント済み: dpb 2021 年 1 月 18 日
x = [1 2 3];
y= [6 13 11];
plot(x,y)
set(gca,'Ydir','reverse')
I tried this code but it flips the y axis. I want to keep both axis the same.
  4 件のコメント
Kofial
Kofial 2021 年 1 月 18 日
編集済み: Kofial 2021 年 1 月 18 日
There is no picture, only a line like the one provided.
This plot(x,-y) doesn't work plot(x,-y) because it converts the y axis in negative values.
This second option either. I don't want to do any changes to the axis, only flip the data.
dpb
dpb 2021 年 1 月 18 日
Remove the -y from the second; that was a figment of the copy/paste...it's the same idea that Star-S shows.

サインインしてコメントする。

採用された回答

Star Strider
Star Strider 2021 年 1 月 18 日
I am not certain what result you want.
Try this:
x = [1 2 3];
y = [6 13 11];
figure
plot(x,max(y)-y+min(y))
.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeGraphics Object Programming についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by