Changing values of axis
9 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Alexander Engman
am 18 Mai 2018
Kommentiert: Alexander Engman
am 21 Mai 2018
Hi!
I have a plot such as in the attached image. As you can see, the y-axis values range from 1E-7 - 10E-7. I would like to rescale it so that it ranges from simply 0.1-1. How would I do that?
Thanks in advance.
Alexander
0 Kommentare
Akzeptierte Antwort
Sandro Lecci
am 18 Mai 2018
Hi Alexander,
To change the limits of the axis do the following:
set(gca, 'YLim', [0.1,1])
However, your data will not be displayed as they are smaller than the lower limit (0.1). You would want to multiply them by a specific factor, such as *1E6 ?
Best, Sandro
Weitere Antworten (1)
Walter Roberson
am 21 Mai 2018
You can set the axes YTickLabels to whatever you want, including to strings that have nothing to do with the actual Y values.
You can use mat2gray() or the new rescale() to change the y values to your desired range before you plot them.
1 Kommentar
Siehe auch
Kategorien
Mehr zu Annotations 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!