How to make the font sizes of Xlabel, Ylabel, and Title different in a heat map using MATLAB?

9 次查看(过去 30 天)
I have used the heatmap function in MATLAB to draw a figure. However, the font sizes of Xlabel, Ylabel, and Ttile are same. How to make the font sizes of Xlabel, Ylabel, and Title different in a heat map?

采纳的回答

Walter Roberson
Walter Roberson 2024-7-19
h = heatmap(......);
warnstate = warning(MATLAB:structOnObject', 'off');
sh = struct(h);
warning(warnstate);
sh.Axes.XLabel.FontSize = as appropriate;
sh.Axes.YLabel.FontSize = as appropriate;
sh.Axes.Title.FontSize = as appropriate;

更多回答(1 个)

aasim Azooz
aasim Azooz 2024-7-26
you can do it in two ways
1- from the edit this object properties in the figure tool bar. you click on tthe xlabel or ylabel and change the font size
2- you can do it from within the code using
xlabel ( 'Text .... ','fontsize',14)
ylabel('Test ....',fontsize',16)

类别

Help CenterFile Exchange 中查找有关 Data Distribution Plots 的更多信息

产品


版本

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by