XGrid and XTick with different space
Show older comments
I need draw a fine grid on a figure and keep the XY Ticks as the default one. To get the fine grid, I referred to the idea using a fine ticks. For example:
figure
plot( [-1 1] , [ -1 1] )
set(gca,'Xtick',-1 : 0.02 : 1);
set(gca,'Ytick',-1 : 0.02 : 1);
grid on;
However, I got plenty of ticks which are not required. I try to remove the ticks, and only keep a few of them. But I can only remove them all or not when using the line below:
set(gca,'XTickLabel','','YTickLabel','')
I am trying to keep the ticks shown the way just like generated by the first 2 line codes. Thank you.
Accepted Answer
More Answers (0)
Categories
Find more on Grid Lines, Tick Values, and Labels in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!