spy with grid

2 次查看(过去 30 天)
Chienmin
Chienmin 2012-4-27
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.

采纳的回答

Chienmin
Chienmin 2012-4-27
Many thanks.
  3 个评论
Chienmin
Chienmin 2012-4-27
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 2012-4-27
But you can vote for and accept answers that are not yours.

请先登录,再进行评论。

更多回答(1 个)

Daniel Shub
Daniel Shub 2012-4-27
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', ':')

类别

Help CenterFile Exchange 中查找有关 Sparse Matrices 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by