Positioning a figure
7 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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??
0 commentaires
Réponses (1)
Ayush Anand
le 4 Avr 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!
0 commentaires
Voir également
Catégories
En savoir plus sur Dialog Boxes dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!