How to set axes grid color?

1 回表示 (過去 30 日間)
Kyle
Kyle 2011 年 7 月 9 日
Hi,
i'm trying to set the grid of x and y of an Axes to gray color so then it doesnt appear in the GUI when i run the code. I know i can set the color manually when designing the GUI but my code requires me to clear the axes. when i do that, all previous setting of my axes is cleared so i need to set back the color. I could set it to white color without error but when i try to set it to gray correspond to [240,240,240] i got error. By any chance i can close the grid? as i couldnt find the setting.
cla(handles.im1,'reset')
set(handles.im1,'YColor','white');
set(handles.im1,'XColor',[240,240,240]);

採用された回答

Paulo Silva
Paulo Silva 2011 年 7 月 9 日
set(axes_handle,'XGrid','off')
set(axes_handle,'YGrid','off')
or all in one line
set(gca,'YGrid','off','YGrid','off')
  2 件のコメント
Kyle
Kyle 2011 年 7 月 9 日
hm i think i said the wrong thing. i wana close then x and y axis.( those numbering along the x and y axis)
Paulo Silva
Paulo Silva 2011 年 7 月 9 日
The numbers must be from 0 to 1
set(gca,'XColor',[0.8,0.8,0.8]);

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMigrate GUIDE Apps についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by