spy with grid

Does any one know how to addgrid when using spy() function? I tried to put 'grid on', but it failed. However, if I add 'grid minor', then it worked; but I dont want the minor grids to be diaplayed.

 Respuesta aceptada

Chienmin
Chienmin el 27 de Abr. de 2012

0 votos

Many thanks.

3 comentarios

Daniel Shub
Daniel Shub el 27 de Abr. de 2012
If the problem is solved please accept my answer. If the problem was not solved, but my answer was helpful, please vote for it.
Chienmin
Chienmin el 27 de Abr. de 2012
I tried to vote it. But it shows: You can't vote for an answer that you created. Sorry, mate. But thanks again.
Daniel Shub
Daniel Shub el 27 de Abr. de 2012
But you can vote for and accept answers that are not yours.

Iniciar sesión para comentar.

Más respuestas (1)

Daniel Shub
Daniel Shub el 27 de Abr. de 2012

1 voto

The key can be found with
type spy
You will see
set(gca,'xlim',[0 n+1],'ylim',[0 m+1],'ydir','reverse', ...
'GridLineStyle','none','plotboxaspectratio',[n+1 m+1 1]);
Setting the GridLineStyle property to none seems a likely source of the "problem". You can get around it with:
spy
grid on
set(gca, 'GridLineStyle', ':')

Categorías

Más información sobre Discrete Data Plots en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 27 de Abr. de 2012

Community Treasure Hunt

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

Start Hunting!

Translated by