How to flip the data upside down without flipping the axes?
조회 수: 22 (최근 30일)
이전 댓글 표시
x = [1 2 3];
y= [6 13 11];
plot(x,y)
set(gca,'Ydir','reverse')
I tried this code but it flips the y axis. I want to keep both axis the same.
댓글 수: 4
dpb
2021년 1월 18일
Remove the -y from the second; that was a figment of the copy/paste...it's the same idea that Star-S shows.
채택된 답변
Star Strider
2021년 1월 18일
I am not certain what result you want.
Try this:
x = [1 2 3];
y = [6 13 11];
figure
plot(x,max(y)-y+min(y))
.
댓글 수: 0
추가 답변 (0개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!