Setting additional specific axis tick marks
36 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Etienne O'Brien
am 16 Jun. 2011
Kommentiert: Walter Roberson
am 8 Mai 2019
I have a y axis that spans 0 - 15. I want to place an extra tick mark (labelled with its value) at the minimum value of y (0.018 in one data set, for example).
It is not appropriate for me to use a log scale - the data is well presented, it is just not obvious to the reader that the minimum value is not zero.
Thank you.
0 Kommentare
Akzeptierte Antwort
Walter Roberson
am 16 Jun. 2011
set(gca, 'YTick', sort([0.018, get(gca, 'YTick')]));
9 Kommentare
Walter Roberson
am 8 Mai 2019
After setting the YTick, you can pull out the YTick again and format the values and send those to the YTickLabels property.
With R2014b or later you would typically only do that if you had special formatting needs, such as needing one label to look different than the others, or if you wanted to convert each value to its multiple of Pi : for plain formatting issues you would instead set the axes YAxis.TickLabelFormat property.
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Axis Labels 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!