How to set default grid to minor

조회 수: 41 (최근 30일)
Jash Patel
Jash Patel 2019년 9월 11일
편집: dpb 2019년 9월 17일
I am trying to have default minor grid for all my plots but it doesn't seem to work when I go to run a code.Screen Shot 2019-09-11 at 3.12.49 PM.png
  댓글 수: 1
dpb
dpb 2019년 9월 11일
편집: dpb 2019년 9월 12일
With R2017b here I seem to see the same symptom.
set(groot,'defaultAxesXminorGrid','on')
has no effect on subsequent displayed axes in new figure/axes object.
OTOH,
set(groot,'defaultAxesXGrid','on')
does result in the X grid being displayed when creating new figure/axes.
In addition, the minor grid still doesn't show up by default even if the major axes default is on so it's not that must have major on for minor to be displayed in the default properties (and one can set minor grid independent of major grid manually for the axes)
Looks like a bug to me unless there's some unexplained logic behind the scenes that doesn't seem to be documented behavior afaict.

댓글을 달려면 로그인하십시오.

답변 (1개)

Pravin Jagtap
Pravin Jagtap 2019년 9월 17일
Hello Jash,
Use following command to set the default behavior of ‘Minor Grid’ on:
set(groot,'defaultAxesXMinorGrid','on','defaultAxesXMinorGridMode','manual');
This is Primarily because some plotting properties use different defaults in different cases. For example, ‘Linewidth’ property uses same defaults in all plotting command whereas ‘Minor Grid’ property uses different defaults in different cases such as ‘semilogx, ‘semiology’. Therefore, we need to set the behavior manually as shown above. Refer following documentation for more details:
Kind Regards
~Pravin
  댓글 수: 1
dpb
dpb 2019년 9월 17일
편집: dpb 2019년 9월 17일
OK, but why, if that is a general rule isn't it made automatic by the set routine for those properties which need it? Or at least, give a warning message "Need to set action mode to 'Manual' for default action to take effect." or somesuch.
There's no list of which do/don't to go by and no klew otherwise than to just manage to guess the problem and happen onto the right subject page.
I've been using ML for 30+ yr and didn't manage to figure it out as can be seen in above response. There's nothing but another subject in the doc; nothing in the basic higher-level discussion to give one the clue you're not done.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Graphics Object Programming에 대해 자세히 알아보기

태그

아직 태그를 입력하지 않았습니다.

제품


릴리스

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by