Changing Plot and Label font

조회 수: 36 (최근 30일)
Nikolay Rodionov
Nikolay Rodionov 2012년 5월 23일
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