Changing Fonts Size in Matlab Plots

前端 未结 7 1887
隐瞒了意图╮
隐瞒了意图╮ 2020-12-07 11:55

I want to change Font Size for xlabel, ylabel, axis size, legend font size a.k.a everything at once, is this possible? By default, font is Helvetic

7条回答
  •  佛祖请我去吃肉
    2020-12-07 12:08

    It's possible to change default fonts, both for the axes and for other text, by adding the following lines to the startup.m file.

    % Change default axes fonts.
    set(0,'DefaultAxesFontName', 'Times New Roman')
    set(0,'DefaultAxesFontSize', 14)
    
    % Change default text fonts.
    set(0,'DefaultTextFontname', 'Times New Roman')
    set(0,'DefaultTextFontSize', 14)
    

    If you don't know if you have a startup.m file, run

    which startup
    

    to find its location. If Matlab says there isn't one, run

    userpath
    

    to know where it should be placed.

提交回复
热议问题