フィルターのクリア

How to modify the veritcal position of sgtitle in a figure?

101 ビュー (過去 30 日間)
KW YAN
KW YAN 2023 年 3 月 7 日
回答済み: Sarvesh Kale 2023 年 3 月 7 日
Hi,
I have read that there is a property "HorizontalAlignment" in sgtitle() object to adjust the horizontal alignment of the text.
I am curious to know if there is any way to modify the veritcal position of the sgtitle text? Thanks!
Best regards,
Kelvin

採用された回答

Sarvesh Kale
Sarvesh Kale 2023 年 3 月 7 日
Hi KW YAN,
You can insert your own title box using annotations, refer the following code
figure;
subplot 211
subplot 212
annotation('textbox',[0.15 0.9 0.1 0.1],'String','Title String','EdgeColor',[105/255 105/255 105/255])
% [0.15 0.9 0.1 0.1] means position the textbox at 0.15 units from figure window left, 0.9 units up from figure window bottom and 0.1x0.1, where 1x1 represnts the whole figure
More information on annotation can be found here. When you go to the properties page of sgtitle, we cannot find the property for verticle alignment, I hope the above workaround helps, if it does not wait for someone from community to answer !
Thank you

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeAnnotations についてさらに検索

製品


リリース

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by