Is there a way to label minor axis ticks in Matlab?

30 ビュー (過去 30 日間)
aam44
aam44 2017 年 4 月 10 日
回答済み: Vandana Ravichandran 2017 年 4 月 14 日
I am using datetick() to display the x axis labels in months. I have added minor ticks as days. I would like to display the day of month just above the month tick label, but cannot find a way to label the minor ticks.
  1 件のコメント
Adam
Adam 2017 年 4 月 10 日
編集済み: Adam 2017 年 4 月 10 日
Well, I think that is essentially the definition of a minor tick. If they had labels they'd be major ticks!
You can probably add your own text objects to the axes, but it would be more effort than you'd probably want even though they could be positioned mathematically in a loop or vectorised manner.

サインインしてコメントする。

採用された回答

Vandana Ravichandran
Vandana Ravichandran 2017 年 4 月 14 日
Minor ticks are meant to be used without labels. Using the "XMinorTick" axes property, you can only control the visibility of minor ticks by setting it to on/off. There is no axes property that can be directly used to set the minor ticks 'labels.
You can possibly set "XMinorTick" to off and adjust XTick accordingly. Please refer this MATLAB answers post: https://www.mathworks.com/matlabcentral/answers/17559-labeling-minor-tick-marks-in-plots

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeGrid Lines, Tick Values, and Labels についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by