Reducing line spacing between multiline figure title

19 ビュー (過去 30 日間)
John Cruce
John Cruce 2024 年 3 月 14 日
コメント済み: Voss 2024 年 3 月 15 日
I have a multiline figure title with larger text on top. I'm trying to reduce the white space between text lines so that the two lines are closer together. I'd also like the second line to have normal weight font, rather than bold.
Any thoughts on how I can accomplish this?
I've included a code snippet below:
t = title({['\fontsize{14}','First Line of Title'];['\fontsize{9}','Second Line of Title']},'FontWeight','Bold','FontName','Helvetica');

採用された回答

Voss
Voss 2024 年 3 月 14 日
This makes the second line a superscript (^{}) so it's closer to the first line, increases its font size (to 11) to account for it being a superscript, and makes it have normal font weight (\rm).
figure
t = title({'\fontsize{14}First Line of Title';'\rm\fontsize{11}^{Second Line of Title}'});
  2 件のコメント
John Cruce
John Cruce 2024 年 3 月 15 日
Great suggestion, thanks.
Is there a simple way to adjust the title down so that there's less white space between the top of the figure and superscript?
Voss
Voss 2024 年 3 月 15 日
Adjust the position as desired; second component is the y-coordinate:
figure
t = title({'\fontsize{14}First Line of Title';'\rm\fontsize{11}^{Second Line of Title}'}, ...
'Units','normalized','Position',[0.5 0.99 0]);

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLabels and Annotations についてさらに検索

製品


リリース

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by