How to rotate graph?

3 ビュー (過去 30 日間)
SuzieChan
SuzieChan 2020 年 4 月 13 日
コメント済み: Adam Danz 2020 年 4 月 13 日
Hi!
What code can I use to flip the orange portion of this graph in the vertical plane, 180 degrees?
>> figure
hold on
scatter(A{:,1}, A{:,2})
% Flip the next line in the veritcal plane
scatter(B{:,1}, B{:,2})

採用された回答

Adam Danz
Adam Danz 2020 年 4 月 13 日
編集済み: Adam Danz 2020 年 4 月 13 日
ax = gca();
ax.XDir = 'reverse';
% or
ax.YDir = 'reverse';
To flip the data vertically rather than the axes,
scatter(x, fliplr(y))
% or
scatter(x, flipud(y))
  2 件のコメント
SuzieChan
SuzieChan 2020 年 4 月 13 日
編集済み: SuzieChan 2020 年 4 月 13 日
figure
hold on
scatter(A{:,1}, A{:,2})
ax = scatter(B{:,1}, B{:,2})
ax = gca();
ax.XDir = 'reverse';
This code flips BOTH blue and orange parts (I think because they are connected to the same axis).
I think I must split the x-axis to reverse only the orange part, right?
Adam Danz
Adam Danz 2020 年 4 月 13 日
Answer updated.

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

その他の回答 (0 件)

カテゴリ

Help Center および File Exchange2-D and 3-D Plots についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by