How to check if the Figures window is docked and to undock it
Show older comments
Often, the Figures window is docked to the main Matlab window by default. How can I write code to undock it and, preferably, to check whether or not it is docked? Note that I'm asking about the Figures window and not about individual figure windows. For reference, I ask because I like to dock figures, e.g.
set(gcf,'windowstyle','docked')
but when sharing code, people may not be familiar with docked figures and so may not be able to find the figures.
Accepted Answer
More Answers (2)
Engenuity
on 27 Mar 2025
Undock a current figure, use the set() function. Once all individual figures are undocked, the Figures window will be undocked (you could loop through them all)
if strcmp(get(gcf, 'windowstyle'), 'docked')
set(gcf, 'windowstyle', 'normal')
end
6 Comments
Walter Roberson
on 27 Mar 2025
set(findall(groot, 'type', 'figure', '-and', 'WindowStyle', 'docked'), 'WindowStyle', 'normal')
No loop needed.
Engenuity
on 28 Mar 2025
🤜🏽🤛🏽
orsijafdsoij
on 28 Mar 2025
Walter Roberson
on 28 Mar 2025
I don't think the Figures window can be docked as such. I believe what happens is that each window is docked independently, with the Figures window disappearing if there are no remaining figures in it.
orsijafdsoij
on 28 Mar 2025
Engenuity
on 1 Apr 2025
I am not familiar with a programmatic way to dock the entire figure window.
orsijafdsoij
on 11 Apr 2025
0 votes
Categories
Find more on Graphics Object Properties in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!