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 CenterFile Exchange 中查找有关 2-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