Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to 'un' bold titles for MATLAB figures?

I'm trying to combine a few Matlab plots into one figure and therefore I'm wondering how I can create 'normal' tiles above my plots instead of the bold titles provided by Matlab. Below an example.

figure
plot((1:10).^2)
title({'First line';'Second line'})
like image 808
Tim Avatar asked Jan 12 '16 09:01

Tim


People also ask

How do you change the font of a title in Matlab?

To change the font units, use the FontUnits property. If you add a title or subtitle to an axes object, then the font size property for the axes also affects the font size for the title and subtitle. The title and subtitle font sizes are the axes font size multiplied by a scale factor.

How do I change the title size in Matlab?

By default the FontSize property is 10 points and the TitleFontSizeMultiplier is 1.100 , which means that the title font size is 11 points. To change the title font size without affecting the rest of the font in the axes, set the TitleFontSizeMultiplier property of the axes.


1 Answers

Make use of the 'FontWeight' argument:

figure
plot((1:10).^2)
title({'First line';'Second line'},'FontWeight','Normal')

Note also that you can access the 'FontWeight' argument for all text objects in your figure in one go---in case you have, e.g., several subplots in your figure---using findall:

myFig = figure;
subplot(2,1,1)
plot((1:10).^2)
title('First plot')
subplot(2,1,2)
plot((1:10).^2)
title('Second plot')

% Set 'Normal' font weight in both titles above
set(findall(myFig, 'Type', 'Text'),'FontWeight', 'Normal')

As stated in the comments above; for a single figure title, you can make use make use of \rm as an alternative. Note however that \rm depends on the (default) choice of 'Interpreter' as 'tex', whereas the approach above is valid for all choices of interpreter (however with no effect for text objects using interpreter 'latex').

like image 166
dfrib Avatar answered Sep 29 '22 10:09

dfrib