How do I dock figures next to the editor by default ?
216 views (last 30 days)
Show older comments
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 Comments
Addy
on 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
on 6 Oct 2025
Try using the flags from inside the figure command :
figure('Name', fig_title, 'Position', 'WindowStyle', 'docked');
Answers (1)
Adam Danz
on 2 Jun 2025
Edited: Adam Danz
on 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.
8 Comments
Leo
on 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.
Nishan Pokhrel
1 minute ago
yeah its pretty annoying, especially when it was possible in previous versions. seems like vibe coding is getting pretty popular on all fronts of technology...
See Also
Categories
Find more on Interactive Control and Callbacks in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!