MATLAB Answers


Adding a title to a graph

Asked by Benjamin
on 5 Dec 2012

I am trying to add a title to a graph I am making. I am using sprintf to allow the title to change depending on the values entered earlier in the script. So far, it is displaying all the wording correctly, but I want to make it bold and it is not working.

Anyone know what the problem is?

title(sprintf('Beam Deflection for a %s Beam \n%6.2f lb. load applied to a %s %s'...



No products are associated with this question.

1 Answer

Answer by Matt Fig
on 5 Dec 2012
 Accepted answer

title(sprintf('Beam %s Beam \n%6.2f lb. applied to a %s %s'...

This works on my machine. Are you saying the fontweight is not bold?


Yes. It is not displaying in bold And I would also like the font size to be 14

Matt Fig
on 5 Dec 2012

Try to set the handle.

T = title('hello');

Join the 15-year community celebration.

Play games and win prizes!

Learn more
Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

MATLAB Academy

New to MATLAB?

Learn MATLAB today!