How do I dock figures next to the editor by default ?
227 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
set(0,'DefaultFigureWindowStyle','docked') does not work. It still opens the figure in a new windows an I have to right click and click on "Dock figures". Alternatively I can press CTRL+Shift+D but I dont want to do that. Typing get(0,'DefaultFigureWindowStyle') gives me "docked" as an answer so the command is working appearently.
How can I make it so the figure appears next to the editor by default without me pressing CTRL+Shift+D everytime ?
4 Kommentare
Addy
am 5 Jun. 2025
Can confirm as well. the docking does not work.
I tried (0,'DefaultFigureWindowStyle','docked')
and set(groot,'DefaultFigureWindowStyle','docked')
This is in 2025a and normal mflies.
I put this figure config in startup.m.
But 2025a just refuses to work.
AZEDDINE
am 6 Okt. 2025 um 7:50
Try using the flags from inside the figure command :
figure('Name', fig_title, 'Position', 'WindowStyle', 'docked');
Antworten (1)
Adam Danz
am 2 Jun. 2025
Bearbeitet: Adam Danz
am 16 Jun. 2025
Starting in MATLAB R2025a, figures created by the figure command appear by default in a figure containter.
The set(groot,'DefaultFigureWindowStyle','docked') command controls whether figures are docked to the figure container.
In the upper right of the figure container is an option to dock the figure container to the desktop.

When docked to the desktop, the figure container is docked next to the editor by default, if the editor is opened.

Future figures generated by the figure command within the same session will appear in the docked figure container unless the WindowStyle is set to Docked or if the figure container is undocked.
7 Kommentare
Adam Danz
am 7 Jul. 2025
> 1) Is there any way to make that figure container docked by default?
As a fellow startup.m customizer, I understand that frustration. No, MATLAB R2025a does not offer a means of programmatically docking the figure container. Once the container is docked interactively, its docking state will persist within the MATLAB session but not between sessions. As you may have learned, the WindowStyle property determines whether the figure is docked to the container -- for a bit more detail, see a recent article about the Tabbed Figure Container in the Graphics and App Building blog.
Your request for similar control of the container's dock state is reasonable. I've passed it along to the right set of ears.
> 2) Is there any way to make that container span the full height of the main window? for the life of me I can't find a way to replicate my old workspace of having 3 pure columns, the comand window always robs space from the figures
Maybe. I took the two screenshots below using R2025a after dragging the command window to the right or left, next to the editor, and then generating a figure. It appears to fit your description. However, there is less flexibility in arrangements than previous releases.

Leo
am 14 Sep. 2025
Just adding my vote that not being able to code for docking the figure container is an annoying step back from the case previously. Also, how should I interpret the comment "Once the container is docked interactively, its docking state will persist within the MATLAB session but not between sessions." If I close all figures, manually or with close all, then I have to repeat the manual figure docking when I next create a figure. So even within a MatLab session, I can't see how to avoid manual figure docking.
Siehe auch
Kategorien
Mehr zu Environment and Settings finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!