How to set default font size and style?
637 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
In R2015a, how do I set the default text for plot titles, ticklabels, and axes labels to 12 point normal font?
0 Commenti
Risposta accettata
Star Strider
il 12 Mag 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 Commenti
Star Strider
il 13 Mag 2015
The get function can have an output argument, so that could have made things easier.
Peter Harrington
il 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
Più risposte (2)
Timothy Dalrymple
il 10 Giu 2020
Modificato: Timothy Dalrymple
il 10 Giu 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);
0 Commenti
Mayra
il 30 Giu 2021
You should use:
set(groot,'defaultAxesFontName','Verdana')
set(groot,'defaultAxesFontSize',12)
And it is possible to set as default several things, for that you need the right class name, to check them:
d = get(groot,'factory');
Substitute factory to default.
To have this setup everytime you open matlab add a startup.m file to your userpath. There is a better explanation about it here: https://blogs.mathworks.com/steve/2019/02/22/making-your-plot-lines-thicker/
0 Commenti
Vedere anche
Categorie
Scopri di più su Specifying Target for Graphics Output in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!