Is there any way to have grid on as default?

61 ビュー (過去 30 日間)
Netanel Freinkel
Netanel Freinkel 2020 年 4 月 30 日
編集済み: Nicholas Tarasenko 2022 年 2 月 3 日
Hi!
Is there any way to make matlab plot all my figures (bode, step, simple plots etc.) with grids? I find it much better.
Thanks!

採用された回答

Mehmed Saad
Mehmed Saad 2020 年 4 月 30 日
set(groot,'defaultAxesXGrid','on')
set(groot,'defaultAxesYGrid','on')
figure,plot(1:10)
  11 件のコメント
Marco Lepidi
Marco Lepidi 2021 年 12 月 21 日
sorry minorticks, but it doesn't work for minorgrid
Nicholas Tarasenko
Nicholas Tarasenko 2022 年 2 月 3 日
編集済み: Nicholas Tarasenko 2022 年 2 月 3 日
I wanted to provide a second method that follows closely to @Mehmed Saad. I have a file called "startup.m" in my MATLAB paths. In the startup file I set the default for all of my plots for every session. I did this so that I don't have to remember to include the default plot syntax in every script.
My startup script has the following defaults:
set(0,'defaultaxesfontname','Helvetica')
set(0,'defaulttextfontname','Helvetica')
set(0,'defaultaxesfontsize',15)
set(0,'defaultaxesfontweight','Bold')
set(0,'defaulttextfontsize',15)
set(0,'defaulttextfontweight','Bold')
set(0,'DefaultLineLineWidth',1.2)
set(0,'DefaultFigureColor', 'white');
set(0,'defaultAxesXGrid','on')
set(0,'defaultAxesYGrid','on')

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

その他の回答 (0 件)

Community Treasure Hunt

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

Start Hunting!

Translated by