dock graphics window size

14 次查看(过去 30 天)
Stephen Leung
Stephen Leung 2018-7-17
评论: Adam Danz 2024-9-3
I use graphics with property editor. I mistakenly resize the window. How do I get back to the default size? When I use 'copy figure' option, the size of the graphics depends on my graphics window size. I find no way to get back to the original default size. Tried exit and restart MATLAB, but it remembers my last window size for the graphics window (with property tool in the bottom)

回答(2 个)

Hitesh
Hitesh 2024-8-26
编辑:Hitesh 2024-8-26
Hello Stephen,
There are several methods to reset the window size to its default settings:
  • Property Inspector: Open the Property Inspector for the figure you wish to adjust. Click on "Figure1" (default view) and modify the position under the Position tab using the format[x, y, width, height].
  • Figure Command: Use the following command to set the figure window size:
fig = figure('Position', [100, 25, 600, 600]);
  • Default Position:Use this command to reset the figure's position and the size to default settings:
set(fig, 'DefaultFigurePosition', 'factory');
figure;
Ihope this resolves your query.
  1 个评论
Adam Danz
Adam Danz 2024-9-3
This last example is incomplete.
set(fig, 'DefaultFigurePosition', 'factory');
figure;
This will not affect the figure's position until the position property is set. Here's the complete version:
fig = figure();
set(fig, 'DefaultFigurePosition', 'factory', 'Position','default');
This is setting the figure's default-position to MATLAB's factory default position and then setting the figure's Position to the default which is defined here as factory. This is review here in the doc.
It's much easier just to set the figure's Position to factory as shown in my answer.

请先登录,再进行评论。


Adam Danz
Adam Danz 2024-9-3
编辑:Adam Danz 2024-9-3
To set an existing figure's position back to the factory default,
set(fig,'Position','factory')
Note that set() must be used with the factory flag as opposed to dot notation.
To reset the default figure position for all future figures (see groot),
set(groot, 'DefaultFigurePosition', 'factory')
You may also want to reset figure units.
set(fig,'Units','factory')
set(groot, 'DefaultFigureUnits', 'factory')

类别

Help CenterFile Exchange 中查找有关 Graphics Object Programming 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by