Setting major and minor ticks labeling
2 views (last 30 days)
Show older comments
Hello
Range of X-axis in my graph is from 0 to 5. I would like to have labels for major ticks 0,1,2,3,4,5 and no labels for minor ticks situated in halfs: 0.5, 1.5, 2.5, 3.5, 4.5.
My problems are:
1. when I use set(gca,'XMinorTick','on') it shows me 4 minor ticks between two major: 0.2, 0.4, 0.6, 0.8, but I would like to have as i mentioned above at half values.
2. since it automatically recognizes range for axis I would like to set only value of increment in order to avoid displaying major tick at half values, but only way, which I found is set(gca,'XTick',0:1:5), which i don't like because everytime if the input data range changes I need to reset the interval manualy. Is there a way how to define only increment value?
0 Comments
Accepted Answer
More Answers (0)
See Also
Categories
Find more on Axis Labels in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!