XGrid and XTick with different space
Mostrar comentarios más antiguos
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.
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Grid Lines, Tick Values, and Labels en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!