Setting major and minor ticks labeling

12 ビュー (過去 30 日間)
Cloud
Cloud 2015 年 1 月 7 日
回答済み: Cloud 2015 年 1 月 11 日
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 Center および File ExchangeAxis Labels についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by