Setting major and minor ticks labeling

6 Ansichten (letzte 30 Tage)
Cloud
Cloud am 7 Jan. 2015
Beantwortet: Cloud am 11 Jan. 2015
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?

Akzeptierte Antwort

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

Weitere Antworten (0)

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by