¿How to change title of plot while using quoted text, variables, multilines and Fontsize?

1 view (last 30 days)
I can make it work separetly but not on the same title. This is what I have now and it's working.
title ([ suj '.' iniciales_cell(suj) 'Grupo' grupo],'fontsize',17);
But now I want to put what's in bold in the first line and what's in italic on the second line.
suj '.' iniciales_cell(suj) Line 1
'Grupo' grupo Line 2
How can I do this?? I tried with {} but i can't make it work with the fontsize and all.
Thanks in advance

Accepted Answer

dpb
dpb on 1 Jun 2017
Edited: dpb on 2 Jun 2017
hTl=title({'\bfLine 1';'\rmLine 2'},'fontsize',17);
Addendum Missed the 'quoted' string--you just have to "double-up" to embed a single quote in a quoted string:
hTl=title({'\bf''Line 1''';'\rm''Line 2'''},'fontsize',17);
  4 Comments
dpb
dpb on 6 Jun 2017
Glad to help...it's easy to get lost in the forest of tick marks in stuff like this and what is really pretty simple just gets messy enough it's hard to figure out where went wrong.

Sign in to comment.

More Answers (0)

Categories

Find more on Labels and Annotations in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!