Effacer les filtres
Effacer les filtres

How to set the defaultAxesFontSize for a Shared Axes Label

2 vues (au cours des 30 derniers jours)
hans
hans le 10 Jan 2022
Réponse apportée : Rijuta le 13 Sep 2023
I can set the defaultAxesFontsize for my plots as:
set(groot,'defaultAxesFontSize' ,18);
This works for me in normal plots.
But this does not seem to affect the AxesFontSize if I use a tiled chart with a Shared Axes Label
t = tiledlayout(2,2,'TileSpacing','Compact');
xlabel(t,'Distance (mm)')
% Tile 1
nexttile
plot(rand(1,20))
title('Sample 1')
% Tile 2
nexttile
plot(rand(1,20))
title('Sample 2')

Réponses (1)

Rijuta
Rijuta le 13 Sep 2023
Hi Hans,
I understand that you want to set the axes font size for a Shared Axes Label.
In your code, the `set(groot,'defaultAxesFontSize', 18)` command sets the default font size for axes in normal plots. However, it does not affect the font size of axes in tiled charts with shared axes labels.
To change the font size in this case, you can use the `AX` output argument of the `nexttile` function to access the axes object and modify its properties.
Kindly refer to the documentation to know more about setting the axes properties: https://www.mathworks.com/help/matlab/ref/nexttile.html - mw_182f5fd9-00a6-42df-b2d3-9f874f0bb759

Catégories

En savoir plus sur Visual Exploration dans Help Center et File Exchange

Produits


Version

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by