Changing Plot and Label font

39 visualizzazioni (ultimi 30 giorni)
Nikolay Rodionov
Nikolay Rodionov il 23 Mag 2012
Hi all,
I have 3 simple questions,
1. Is it possible to change the font sizes of the numbers on a plot's axes? If so, how?
2. I make frequent use of the property editor to change the font size of my plot's labels, how can I code for this?
3. Is it possible to change the font style of labels on a plot (i.e bold italic ect.)?
Thank you, Nikolay

Risposta accettata

Oleg Komarov
Oleg Komarov il 23 Mag 2012
Suppose you have the following example:
x = -pi:.1:pi;
y = sin(x);
plot(x,y)
lx = xlabel('x');
ly = xlabel('y');
1. Change FontSize
set(gca,'FontSize',14)
2. Yes. When creating labels, store their handles into some variables, then use set(). See also get() and the useful inspect().
3. Yes. To control string properties see this link http://www.mathworks.co.uk/help/techdoc/ref/text_props.html#String
set(lx,'string','\it x')

Più risposte (0)

Community Treasure Hunt

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

Start Hunting!

Translated by