Change spacing between title lines

I have a multi-line title I'm trying to change the spacing between. The first line is size 14 font, the second line is size 10 font. The gap between the lines feels especially big. Any thoughts or suggestions on how to correct this? Code provided below.
t = title({['\fontsize{14}','Line 1']; ...
['\fontsize{10}',sprintf('Line 2',variable)]}, ...
'FontWeight','Normal');

1 件のコメント

dpb
dpb 2021 年 9 月 11 日
Amongst anything else,
sprintf('Line 2',variable)
isn't valid syntax; missing a format expression for a variable which is undefined/unknown in isolation...

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

回答 (2 件)

Image Analyst
Image Analyst 2021 年 9 月 12 日

1 投票

It doesn't seem that big to me. Any less and it would be too crowded
plot([0 1]) % Create axes with a plot in it.
[t, s] = title('Line 1 is the main title','Line 2 is the subtitle','Color','blue');
t.FontSize = 14; % Set main title font.
s.FontSize = 10; % Set subtitle font.
Sulaymon Eshkabilov
Sulaymon Eshkabilov 2021 年 9 月 12 日

1 投票

In your exercise, one of the viable solutions is to create one necessarily formatted blank line between the two lines. Here is one thread that discusses and demonstrates this approach: https://www.mathworks.com/matlabcentral/answers/59545-how-can-i-change-the-space-between-multiline-title?s_tid=answers_rc1-3_p3_Topic

カテゴリ

ヘルプ センター および File ExchangeArgument Definitions についてさらに検索

製品

リリース

R2018a

質問済み:

2021 年 9 月 11 日

回答済み:

2021 年 9 月 12 日

Community Treasure Hunt

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

Start Hunting!

Translated by