How to flip the data upside down without flipping the axes?
12 次查看(过去 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 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Graphics Object Programming 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!