Flipping a plot by 180 degrees

359 次查看(过去 30 天)
Hi!
I want to flip/rotate the plot in the attachment, such that the right part of the plot is rotated to the left and vice versa. I have used flip command but doesn't seem to work. I have also used camroll(-90), view() and set(gca,'YDir','reverse') to achieve my desired result.
RADF_LS vs PA_scatter2.jpg

采纳的回答

Bruno Luong
Bruno Luong 2019-1-14
编辑:Bruno Luong 2019-1-14
[x,y]=find(peaks>0.7)
close all
subplot(2,1,1);
plot(x,y,'or')
subplot(2,1,2);
plot(x,y,'or');
% This command will rotate the plot by 180 degree
set(gca,'xdir','reverse','ydir','reverse')
  6 个评论
Bruno Luong
Bruno Luong 2019-1-16
编辑:Bruno Luong 2019-1-16
If you want to rotate 180 by keeping the same axis range, you need to change the data.
[x,y]=find(peaks>0.7);
xf = min(x(:))+max(x(:))-x;
yf = min(y(:))+max(y(:))-y;
close all
subplot(2,1,1);
plot(x,y,'or')
subplot(2,1,2);
plot(xf,yf,'or');
Subha Bose
Subha Bose 2019-1-21
Bruno,
Thanks for your help. I am getting the desired output now!

请先登录,再进行评论。

更多回答(1 个)

Sayyed Ahmad Fani Yazdi
if your x values are positive nambers you need only use
x=-x
and plot again. It could be flip your plot at y axis
  1 个评论
Subha Bose
Subha Bose 2019-1-14
Although the above suggestion worked, once I use -x values, I am unable to insert positive x-axis ticks. Is there a way to flip the plot as well as use positive values for the x-axis ?

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Line Plots 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by