I have data in a 2d plot, but I want to display it as a "waterfall" with the first value x(0),y(0) at the top, and x(i),y(i) at the bottom. You can visualize just flipping the plot over the x axis. This can be simply done by inverting the y data, but then on the plot, I have negative y values when in reality, they are positive. Is there any way to "flip" the plot?

1 件のコメント

Veronica yep
Veronica yep 2017 年 6 月 27 日
can you post the code for creating this 2d waterfall please? if you still have it

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

 採用された回答

Sean de Wolski
Sean de Wolski 2013 年 2 月 19 日

0 投票

flipud() or fliplr() ?
doc fliplr
doc flipud

3 件のコメント

Jared
Jared 2013 年 2 月 19 日
I explored those, and I thought flipud would work. However, if you have x=[1;2;3] and y=[4;5;6] and x2=flipud(x) and y2=flipud(y)...x2=[3;2;1] and y2=[6;5;4], both plots will look the same. If I could do flipud(plot(x,y)), that is the effect I am going for...
Sean de Wolski
Sean de Wolski 2013 年 2 月 19 日
What about just changing the 'XDir' of the axes to 'reverse' so that it's flipped?
plot(whatever);
set(gca,'XDir','reverse');
Jared
Jared 2013 年 2 月 19 日
Perfect! Thanks

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

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeMatrices and Arrays についてさらに検索

タグ

質問済み:

2013 年 2 月 19 日

コメント済み:

2017 年 6 月 27 日

Community Treasure Hunt

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

Start Hunting!

Translated by