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

 Accepted Answer

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;

More Answers (1)

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)

Categories

Products

Release

R2023b

Asked:

on 19 Jul 2024

Commented:

on 21 Jan 2025

Community Treasure Hunt

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

Start Hunting!