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 Center および File ExchangeGraphics Object Programming についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by