How to flip the data upside down without flipping the axes?
22 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Kofial
am 18 Jan. 2021
Kommentiert: dpb
am 18 Jan. 2021
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 Kommentare
dpb
am 18 Jan. 2021
Remove the -y from the second; that was a figment of the copy/paste...it's the same idea that Star-S shows.
Akzeptierte Antwort
Star Strider
am 18 Jan. 2021
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 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu 2-D and 3-D Plots finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!