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