Changing Plot and Label font

27 次查看(过去 30 天)
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

采纳的回答

Oleg Komarov
Oleg Komarov 2012-5-23
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')

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Axis Labels 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by