Reputation: 4585
a=[1 2 7 5 4 6]
t=0:2:10
plot(t,a);
I want that in the plot on x axis only values : 0, 2, 4, 6, 8, 10 (as per t=0:2:10 in the code) should be depicted on the time axis unlike the above which shows all values. How do I do this ?
Upvotes: 3
Views: 1760
Reputation: 11168
Those are the xticks, set them like this:
set(gca,'Xtick',0:2:10);
If you want to hide the yticks:
set(gca,'Ytick',[]);
Upvotes: 5