Change x axis marking regardless of x?

Imagine what I draw, for example. this is:

plot(1:1500,1:1500) 

This will look like the one below, with the x axis starting at 0 and up to 1500.

Now I do not want to have such a marking, but instead, the designation of the x axis should begin with, for example. 1, and then ends at 151 (an increase of 1/10 for each point on the x axis, an additional offset of 1).

I just want to change the marking of the x axis, I do not want to change the input vector x to a graph function, and I do not want to build other points. I just want the x marking to start at a different offset and increase in the size of the other step, regardless of the x values ​​passed to the graph function.

Is it possible? How? This will make things easier for me. Thanks for any hint!

enter image description here

+4
source share
1 answer

You can customize labels using the Xtick and XTickLabel axis properties .

Example:

 x = 1:7; y = rand(size(x)); plot(x,y) set(gca, 'XTickLabel',{'Mon','Tue','Wed','Thu','Fri','Sat','Sun'}) 

screenshot

+8
source

All Articles