필터 지우기
필터 지우기

Setting additional specific axis tick marks

조회 수: 48 (최근 30일)
Etienne O'Brien
Etienne O'Brien 2011년 6월 16일
댓글: Walter Roberson 2019년 5월 8일
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.

채택된 답변

Walter Roberson
Walter Roberson 2011년 6월 16일
set(gca, 'YTick', sort([0.018, get(gca, 'YTick')]));
  댓글 수: 9
Jafar Habshee
Jafar Habshee 2019년 5월 8일
How can the label be added in similar fasion?
Walter Roberson
Walter Roberson 2019년 5월 8일
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.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Axis Labels에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by