필터 지우기
필터 지우기

How can I make the default LabelFontSize work also for a tiledlayout ?

조회 수: 3 (최근 30일)
hans
hans 2022년 1월 12일
댓글: hans 2022년 1월 13일
How can I make the default LabelFontSize work also for a tiledlayout ?
The setting which works for nomal plots does not work for me in tiledlayout
For illustration, compare the correct font size for xlabel and ylabel in Sample 0 and the small font size in Sample 1 and Sample 2
set(groot,'defaultAxesFontSize' ,24);
set(groot,'defaultTextFontSize' ,24);
set(groot,'defaultAxesTitleFontSizeMultiplier' ,1);
set(groot,'defaultAxesLabelFontSizeMultiplier' ,1.2);
% Here the label size is set as expected
figure('Position', [0 100 500 500]); r=axes;
plot(r,rand(1,20)); title('Sample 0');
xlabel(r,'Distance (mm)'); ylabel(r,'Amplitude (mm)');
% Here the label size is NOT set
figure('Position', [550 100 1000 500])
t = tiledlayout(1,2,'TileSpacing','Compact');
nexttile; plot(rand(1,20)); title('Sample 1');
nexttile; plot(rand(1,20)); title('Sample 2');
xlabel(t,'Distance (mm)'); ylabel(t,'Amplitude (mm)');
  댓글 수: 6
Adam Danz
Adam Danz 2022년 1월 13일
I don't think there is a default setting for x/y labels assigned to TiledChartLayout objects.
You can, of course, assign the fontsize directly using,
xlabel(t,'Distance (mm)', 'FontSize', 24)
or instead of 24, get(groot, 'defaultAxesFontSize') but that won't use the defaultAxesLabelFontSizeMultiplier value.
hans
hans 2022년 1월 13일
Yes, I can set them everywhere individually.
Thank You.

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

답변 (0개)

카테고리

Help CenterFile Exchange에서 Axis Labels에 대해 자세히 알아보기

제품


릴리스

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by