MATLAB Answers

How to set default font size and style?

조회 수: 453(최근 30일)
K E
K E 12 May 2015
In R2015a, how do I set the default text for plot titles, ticklabels, and axes labels to 12 point normal font?

채택된 답변

Star Strider
Star Strider 12 May 2015
I didn’t test this because I don’ want to change my installation or current property values, but see the documentation for Default Property Values.
Specifically, see if:
set(groot,'defaultFontName','Parchment')
or to some font more to your liking does what you want.
  댓글 수: 3
Peter Harrington
Peter Harrington 5 Feb 2019
does not work in MATLAB 2018
set(groot,'defaultFontName','Verdana')
Error using matlab.ui.Root/set
fontname is an invalid class name

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

추가 답변(1개)

Timothy Dalrymple
Timothy Dalrymple 10 Jun 2020
편집: Timothy Dalrymple 10 Jun 2020
I can't promise that his works in all cases, but I include this line at the top of my code and it sets all plots in my code.
So, I just skip the use of graphics root object (groot) set(groot,'defaultFontName','Verdana')
set(0, 'DefaultAxesFontSize', 18);

Community Treasure Hunt

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

Start Hunting!

Translated by