4
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

MATLAB:グラフのデフォルト設定の変更

Last updated at Posted at 2023-08-08

概要

  • 論文や技術文書用に,MATLABのグラフのデフォルト設定を変更する.

設定一覧の取得

settings = get(0,'Factory')
fields = fieldnames(settings)
  • fieldsにはプロパティ名の一覧が代入される.
{'factoryAnimatedlineAlignVertexCenters'                      }
{'factoryAnimatedlineBusyAction'                              }
{'factoryAnimatedlineButtonDownFcn'                           }
{'factoryAnimatedlineClipping'                                }
{'factoryAnimatedlineColor'                                   }
{'factoryAnimatedlineCreateFcn'                               }
{'factoryAnimatedlineDeleteFcn'                               }
以下,続く

デフォルト設定の変更

  • fieldsに代入されたプロパティ名のプレフィックスfactorydefaultに変更して,所望の設定をセットする.
font_face = "times";
set(gcf,"defaultAxesFontName", font_face)
set(gcf,"defaultBubblelegendFontName", font_face)
set(gcf,"defaultColorbarFontName", font_face)
set(gcf,"defaultConstantlineFontName", font_face)
set(gcf,"defaultGeoaxesFontName", font_face)
set(gcf,"defaultGraphplotEdgeFontName", font_face)
set(gcf,"defaultGraphplotNodeFontName", font_face)
set(gcf,"defaultLegendFontName", font_face)
set(gcf,"defaultPolaraxesFontName", font_face)
set(gcf,"defaultRootFixedWidthFontName", font_face)
set(gcf,"defaultTextFontName", font_face)
set(gcf,"defaultTextarrowshapeFontName", font_face)
set(gcf,"defaultTextboxshapeFontName", font_face)
set(gcf,"defaultUibuttongroupFontName", font_face)
set(gcf,"defaultUicontrolFontName", font_face)
set(gcf,"defaultUipanelFontName", font_face)
set(gcf,"defaultUitableFontName", font_face)

font_size = 4;
set(gcf,"defaultAxesFontSize", font_size)
set(gcf,"defaultBubblelegendFontSize", font_size)
set(gcf,"defaultColorbarFontSize", font_size)
set(gcf,"defaultConstantlineFontSize", font_size)
set(gcf,"defaultGeoaxesFontSize", font_size)
set(gcf,"defaultGraphplotEdgeFontSize", font_size)
set(gcf,"defaultGraphplotNodeFontSize", font_size)
set(gcf,"defaultLegendFontSize", font_size)
set(gcf,"defaultPolaraxesFontSize", font_size)
set(gcf,"defaultTextFontSize", font_size)
set(gcf,"defaultTextarrowshapeFontSize", font_size)
set(gcf,"defaultTextboxshapeFontSize", font_size)
set(gcf,"defaultUibuttongroupFontSize", font_size)
set(gcf,"defaultUicontrolFontSize", font_size)
set(gcf,"defaultUipanelFontSize", font_size)
set(gcf,"defaultUitableFontSize", font_size)

set(gcf,"defaultAxesTickLabelInterpreter", "latex")
set(gcf,"defaultBubblelegendInterpreter", "latex")
set(gcf,"defaultColorbarTickLabelInterpreter", "latex")
set(gcf,"defaultConstantlineInterpreter", "latex")
set(gcf,"defaultGraphplotInterpreter", "latex")
set(gcf,"defaultLegendInterpreter", "latex")
set(gcf,"defaultPolaraxesTickLabelInterpreter", "latex")
set(gcf,"defaultTextInterpreter", "latex")
set(gcf,"defaultTextarrowshapeInterpreter", "latex")
set(gcf,"defaultTextboxshapeInterpreter", "latex")
  • ここでは,以下の設定をしてます.
    • フォントをTimes New Romanに変更
    • フォントサイズを4ptに変更
    • すべてのテキストインタラプタでLaTeXを有効化
4
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?