Trying to increase the maximum width of OuterPosition (plot is cut off)

2 ビュー (過去 30 日間)
David Gillcrist
David Gillcrist 2024 年 3 月 12 日
コメント済み: David Gillcrist 2024 年 3 月 13 日
I have the following code
f = figure();
f.Units = "inches";
f.OuterPosition = [0 0 7 2.5]
f =
Figure (1) with properties: Number: 1 Name: '' Color: [1 1 1] Position: [0 0.0202 7.0000 2.2727] Units: 'inches' Use GET to show all properties
ax1 = axes(f,'Units','inches','Position',[0.25 0.25 2 2], ...
'XGrid','on','YGrid','on');
ax2 = axes(f,'Units','inches','Position',[2.5 0.25 2 2], ...
'XGrid','on','YGrid','on');
ax3= axes(f,'Units','inches','Position',[4.75 0.25 2 2], ...
'XGrid','on','YGrid','on');
plot(ax1,[0 1 2 3],[0 1 2 3])
ylabel("$y$","Interpreter","latex")
xlabel("$x$","Interpreter","latex")
plot(ax2,[0 1 2 3],[0 -1 -2 -3])
ylabel("$y$","Interpreter","latex")
xlabel("$x$","Interpreter","latex")
plot(ax3,[0 1 2 3],[0 1 2 3].^2)
ylabel("$y$","Interpreter","latex")
xlabel("$x$","Interpreter","latex")
When it produces a the plots, they're all cut off. I want the images to be to scale for a paper, hence why the width is 7". It seems that MATLAB is enforcing some hard limit on the maximum width it will allow for plotting, is there any way around this?
  7 件のコメント
Voss
Voss 2024 年 3 月 13 日
@David Gillcrist: Did you try setting the figure's Position rather than OuterPosition (as I mentioned here), and did that fix the problem?
David Gillcrist
David Gillcrist 2024 年 3 月 13 日
It appears the issues was just that the OuterPosition of each axis was being plotted outside the OuterPosition of the figure. I didn't need to adjust the Position of the figure itself, only shrink the position values of each axis so their OuterPositions would be within the boundary

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeSpecifying Target for Graphics Output についてさらに検索

タグ

製品


リリース

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by