필터 지우기
필터 지우기

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 CenterFile Exchange에서 Annotations에 대해 자세히 알아보기

제품


릴리스

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by