Is it possible to use axis tics lables without xtics?
2 views (last 30 days)
Show older comments
Is it possible to use axis tics lables without xtics?
0 Comments
Answers (2)
Walter Roberson
on 23 Nov 2016
If you are using R2014b or later (might require R2015a), you could try setting the XAxis TickLength property to 0. See https://www.mathworks.com/help/matlab/ref/numericruler-properties.html
0 Comments
Star Strider
on 22 Nov 2016
It is, but the results are unpredictable. It’s best to use both 'XTick' and 'XTickLabel' together to be certain that what you want is what you get.
4 Comments
Star Strider
on 25 Nov 2016
The most obvious way is to provide more 'XTickLabel' values (or strings or whatever) than there are original 'XTick' values. So if there are ‘n’ original 'XTick' values and you want to label more than that, only the first ‘n’ of your labels will be displayed. Similarly, if you define fewer than ‘n’, they will be displayed in the corresponding 'XTick' locations, leaving the remaining 'XTickLabel' values blank.
To display all the ones you want to the way you want to, you have to re-define the 'XTick' values to the number you want, and to be within the bounds of the original 'XTick' values, such as I described in my code snippet. If you re-define the axis limits using 'XLim' for example, you have to re-define the 'XTick' and 'XTickLabel' vectors as well.
Experiment with these to see the results.
See Also
Categories
Find more on Axis Labels in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!