Setting major and minor ticks labeling

조회 수: 1 (최근 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 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