Change font size on plot but it's cut-off
Ältere Kommentare anzeigen
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 Kommentare
Jan
am 20 Jul. 2022
The information are too lean to suggest a solution. You have a GUI, increase the font size and at some locations something is cut off. This daos not allow to understand, which obejcts must be expanded or made smaller.
DavidL88
am 20 Jul. 2022
Jonas
am 20 Jul. 2022
if you have only a single axis in your figure and you want to avoid cut off, use
set(gca,'Units','normalized','OuterPosition',[0 0 1 1])
this fits the whole axis content including title and labels etc into the figure and maximizes the axis' size
DavidL88
am 21 Jul. 2022
Antworten (1)
Adam Danz
am 20 Jul. 2022
0 Stimmen
Axes produced in tiledlayout usually handle these situations better.
If you want the outer position to remain stable when long lables are added, set
ax.PositionConstraint = 'outerposition'; % ax is your axes object
Kategorien
Mehr zu Creating, Deleting, and Querying Graphics Objects finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
