Change font size on plot but it's cut-off

조회 수: 25 (최근 30일)
DavidL88
DavidL88 2022년 7월 20일
댓글: DavidL88 2022년 7월 21일
I have a plot from a GUI based on MatLab. I made the font bigger for publication purposes but the font is cut off in certain parts. I have tried various solutions but haven't found one that works.
This below moves it around but within window so if I move it up the top is cut off, if I move down, bottom is cut off. Need the window to be bigger.
pos = get(gca,'Position');
set(gca,'Position',[pos(1) pos(2)+10 pos(3)-0.1 pos(4)-0.2]);
I tried this but makes the window bigger and the image very small. I tried diferent numbers.
set(gcf, 'units','normalized','outerposition',[0,0,1,1]);
I include the below data which I used to try and adjust the parameters in the above code.
pos = get(gca,'Position');
pos =
1.0e+03 *
0.0725 0.0500 1.2500 0.4930
outpos = get(gcf, 'outerposition');
outpos =
556 474 1371 607
  댓글 수: 5
Adam Danz
Adam Danz 2022년 7월 20일
편집: Adam Danz 2022년 7월 20일
What are the units of your axes?
Are your axes regular axes or uiaxes?
How are you increasing the fontsize?
A minimal working exampling would be great.
DavidL88
DavidL88 2022년 7월 21일
Thanks all for the answers. This (below) worked.
set(gca,'Units','normalized','OuterPosition',[0 0 1 1])

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

답변 (1개)

Adam Danz
Adam Danz 2022년 7월 20일
Suggestion 1: used tiledlayout
Axes produced in tiledlayout usually handle these situations better.
Suggestion 2: check the PositionConstraint property of your axes.
If you want the outer position to remain stable when long lables are added, set
ax.PositionConstraint = 'outerposition'; % ax is your axes object

카테고리

Help CenterFile Exchange에서 Line Plots에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by