How to give different font size to label values and label names?

조회 수: 11 (최근 30일)
Palguna Gopireddy
Palguna Gopireddy 2022년 12월 16일
댓글: Palguna Gopireddy 2022년 12월 19일
Using
set(gca,'FontName', 'TimesNewRoman', 'FontSize',16,'FontWeight', 'Bold');
We can change the font size of label values and label names. But this is giving equal font size to both of them.
I want to use different font size to label values and label names. How to do it.
I am asking this because generally in paper publishing, different font size is used for them. I want to export the image from the drawn figure and paste it directly on the paper.
  댓글 수: 1
VBBV
VBBV 2022년 12월 16일
Do you mean different font sizes for text and numbers on axes ?

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

채택된 답변

Jan
Jan 2022년 12월 16일
편집: Jan 2022년 12월 16일
Simply specify the font directly:
plot(rand(5))
set(gca,'FontName', 'TimesNewRoman', 'FontSize',16,'FontWeight', 'Bold');
xlabel('This is x', 'FontSize', 12, 'FontName', 'monospaced', 'FontWeight', 'normal')
Alternatively set the parameters as default of the figure:
figure('DefaultAxesFontSize', 16, 'DefaultAxesLabelFontSize', 1.5);
plot(rand(5))
xlabel('The X label')
I'm not sure, why the AxesLabelFontSize is multiplied here. I did not expect this. Maybe this is a bug in the online viewer. Try it locally.
  댓글 수: 3
Jan
Jan 2022년 12월 17일
The full name of the setting is 'defaultAxesLabelFontSizeMultiplier' and therefore it is obviously the factor between the font size of the axes and its labels.

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

추가 답변 (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