dock graphics window size

14 visualizaciones (últimos 30 días)
Stephen Leung
Stephen Leung el 17 de Jul. de 2018
Comentada: Adam Danz el 3 de Sept. de 2024
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)

Respuestas (2)

Hitesh
Hitesh el 26 de Ag. de 2024
Editada: Hitesh el 26 de Ag. de 2024
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 comentario
Adam Danz
Adam Danz el 3 de Sept. de 2024
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.

Iniciar sesión para comentar.


Adam Danz
Adam Danz el 3 de Sept. de 2024
Editada: Adam Danz el 3 de Sept. de 2024
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')

Categorías

Más información sobre Graphics Object Programming en Help Center y File Exchange.

Etiquetas

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by