Id like to make the x axis labels so that it just shows 1,2,3,4,5,6. But id like to make sure this is general so in my code if the user were to input 10 years lets say, the x axis labels would be 1,2,3,4,5,6,7,8,9,10.
the x values are a vector. Im not sure what you mean by duration, double and datetick. I am a beginner to a matlab, so I dont know what terminology youre referring to.
Hi, thanks for your response, however, it doesnt seem to work. What is ax? Is that the name of the x vector?Matlab also says that it doesnt recognize XTicks.
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
2 Comments
Walter Roberson (view profile)
Direct link to this comment
https://ww2.mathworks.cn/matlabcentral/answers/491194-how-to-change-the-x-axis-labels-of-a-plot-so-that-they-only-show-integer-values#comment_767478
AStar (view profile)
Direct link to this comment
https://ww2.mathworks.cn/matlabcentral/answers/491194-how-to-change-the-x-axis-labels-of-a-plot-so-that-they-only-show-integer-values#comment_767481
Sign in to comment.