minor grid in consecutive plots

41 visualizaciones (últimos 30 días)
G A
G A el 9 de Abr. de 2021
Comentada: G A el 10 de Abr. de 2021
If I run the following code (within a script or command window) several times, then the minor grids will be 'on' only every other time. Why?
x=-2*pi:0.1:2*pi;
y=sin(x);
figure(1)
hold on
plot(x,y);
grid on
grid minor

Respuesta aceptada

Walter Roberson
Walter Roberson el 9 de Abr. de 2021
grid minor toggles the visibility of the minor grid lines. Minor grid lines lie between the tick marks. Not all types of charts support minor grid lines.
You probably want
set(gca, 'XMinorGrid', 'on', 'YMinorGrid', 'on')
  3 comentarios
Walter Roberson
Walter Roberson el 10 de Abr. de 2021
grid minor toggles the visibility of the minor grid lines
So the first time you call it, it turned it from default off to on. The second time you call it, it turns it off. The third time you call it, it turns it on...
G A
G A el 10 de Abr. de 2021
Understood. Thanks!

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Logical en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2020b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by