Setting major and minor ticks labeling

4 次查看(过去 30 天)
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?

采纳的回答

Cloud
Cloud 2015-1-11
HEY! Here was a discussion about the problem. Why it is deleted now???

更多回答(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