How can I modify the size of label in boxplot?

6 次查看(过去 30 天)
I created a boxplot with by the following function:
h= boxplot([tas_O2,tas_DeQM,tas_KeQM,tas_Dv,tas_Kv],'labels',{'Obs','M1_e','M2_e','M1_v','M2_v'});
I would like to change the original size of the labels. Could someone write me what I should to do?

回答(1 个)

Meet
Meet 2024-8-1,7:45
Hi Szabó,
You can modify the size of the labels in a boxplot by adjusting the 'axes' properties and setting the corresponding font size for the 'XAxis' and 'YAxis' labels.
For Example:
h = boxplot([tas_O2, tas_DeQM, tas_KeQM, tas_Dv, tas_Kv], 'labels', {'Obs', 'M1_e', 'M2_e', 'M1_v', 'M2_v'});
% Get the current axes
ax = gca;
% Set the font size for the x-axis labels
ax.XAxis.FontSize = 12;
% Set the font size for the y-axis labels
ax.YAxis.FontSize = 12;
For more information, you can refer to the following documentation link:

标签

Community Treasure Hunt

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

Start Hunting!

Translated by