Borrar filtros
Borrar filtros

Positioning a figure

3 visualizaciones (últimos 30 días)
Venkat Alagarsamy
Venkat Alagarsamy el 18 de Mzo. de 2011
Respondida: Ayush Anand el 4 de Abr. de 2024
Is there no way to change the position of a figure if it is docked. I am trying to place three child dockable figures into a main figure and want to set the position of the three child figures. Is that possible??

Respuestas (1)

Ayush Anand
Ayush Anand el 4 de Abr. de 2024
Hi,
In MATLAB, when you dock figures MATLAB's IDE manages their layout, and direct control over the positioning of docked figures is limited, as docked figures are managed by the MATLAB Desktop, and specific positioning is typically handled through the desktop layout rather than programmatically. However, you might consider alternative approaches that give you more control over the layout, like using the "uipanel" within a figure.
Instead of using docked figures, you can create a single main figure and divide it into sections using "uipanel". Each "uipanel" can act as a container for other UI components or custom plots. This approach gives you full control over the size and position of each panel within the main figure.
mainFig = figure('Name', 'Main Figure', 'Position', [100, 100, 800, 600]);
% Create three panels within the main figure
panel1 = uipanel('Parent', mainFig, 'Position', [0, 2/3, 1, 1/3], 'Title', 'Panel 1');
panel2 = uipanel('Parent', mainFig, 'Position', [0, 1/3, 1/2, 1/3], 'Title', 'Panel 2');
panel3 = uipanel('Parent', mainFig, 'Position', [1/2, 1/3, 1/2, 1/3], 'Title', 'Panel 3');
% Example of adding a plot to a panel
axes('Parent', panel1);
plot(sin(1:0.1:25));
You can read more about "uipanel" in MATLAB here: https://www.mathworks.com/help/matlab/ref/uipanel.html
Hope this helps!

Categorías

Más información sobre Migrate GUIDE Apps en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by