How can I make my plot fill the entire figure window?

102 ビュー (過去 30 日間)
Devin Cortes
Devin Cortes 2019 年 1 月 7 日
コメント済み: Jan 2019 年 3 月 28 日
Everytime I plot on matlab, instead of the plot taking up the normal amount of space on the figure window, it does this:
How can I reset this?

回答 (3 件)

Jan
Jan 2019 年 1 月 7 日
編集済み: Jan 2019 年 3 月 28 日
Please post your code. We can see some parts of if in the screenshot, but posting a minimal working example, which reproduces the problem is much more useful.
Can you confirm that this does not create the wanted output:
figure;
axes('Units', 'normalized', 'Position', [0 0 1 1]);
plot(1:10, rand(10, 10))
?
  1 件のコメント
Devin Cortes
Devin Cortes 2019 年 1 月 7 日
My code simply tests a plot:
x = [1:5];
y = [1:5];
plot(x,y)
I attempted that and it does not give the desired output, the plot is still only in the top left corner of te figure window.

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


Ba Mo
Ba Mo 2019 年 3 月 28 日
same problem here
i still can't solve it, but i think a key to any solution is adjusting the axes position and size, according to the TightInset property.
you can NOT change this tightinset property, you can only measure it. it reports to you the size of empty space in each direction. this is good because title, axes labels and legends are considered useful information.
  2 件のコメント
Ba Mo
Ba Mo 2019 年 3 月 28 日
as i expected, TighInset property has to do with it. In fact, Matlab help documentation has the solution. the help page is titled: Save Plot with Minimal White Space
i hope this does it for you
Jan
Jan 2019 年 3 月 28 日
@Ba Mo: I do not see how this page answers the original question. The OP Devin Cortes seemed to struggle with the default positions of axes. I guess, that he has redefined the 'DefaultAxesPosition' or 'FactoryAxesPosition' property of the root object, maybe in the startup.m, a modified matlabrc.m or in a software he is running. (Maybe the property is called 'DefaultFigureAxesPosition' or similar). The details have not been provided yet.

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


madhan ravi
madhan ravi 2019 年 1 月 7 日
  2 件のコメント
Devin Cortes
Devin Cortes 2019 年 1 月 7 日
I attempted this, and the plot still only appears in top left corner of figure window
madhan ravi
madhan ravi 2019 年 1 月 7 日
It's better you contact mathworks support team by clicking the Contact Us button on the top right corner of this page.

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

カテゴリ

Help Center および File ExchangeGraphics Performance についてさらに検索

製品


リリース

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by