필터 지우기
필터 지우기

How to change the position of the subtext?

조회 수: 2 (최근 30일)
Duzitian Li
Duzitian Li 2023년 4월 18일
댓글: Duzitian Li 2023년 4월 26일
Dear all,
I am adding text to the figure using the next command:
text('string','NO_{x}','Units','normalized','position',[0.24,0.45],'fontsize',18,'backgroundcolor','none','edgecolor','none','color',[238 154 7]./255,'fontname','arial')
I was expecting that the 'x' would not be too low but the text came out in the figure like this:
How am I supposed to adjust the relative position of a subtext? I know that using latex interpreter would make it seem much better but is there any other options to keep the font style at the same time?
Thanks in advance.

답변 (1개)

Sufiyan
Sufiyan 2023년 4월 25일
Hi,
You can try separating the subtext into a second ‘text’ object. You can adjust the x and y coordinates of second text object as needed to change the position of the subtext.
text('string','NO','Units','normalized','position',[0.24,0.45],'fontsize',18,'backgroundcolor','none','edgecolor','none','color',[238 154 7]./255,'fontname','arial')
text('string','x','Units','normalized','position',[0.32,0.41],'fontsize',13,'backgroundcolor','none','edgecolor','none','color',[238 154 7]./255,'fontname','arial','VerticalAlignment','bottom')
Hope this helps!
  댓글 수: 1
Duzitian Li
Duzitian Li 2023년 4월 26일
Thank you so much! I notice that the fontstyle could also affect the performance of subtexts, and I think your method is great by keeping the original fontstyle.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 MATLAB Report Generator에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by