Flipping a plot by 180 degrees
조회 수: 356 (최근 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.
댓글 수: 0
채택된 답변
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
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');
추가 답변 (1개)
Sayyed Ahmad Fani Yazdi
2019년 1월 14일
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
참고 항목
카테고리
Help Center 및 File Exchange에서 Line Plots에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!