How to check if the Figures window is docked and to undock it
Mostrar comentarios más antiguos
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.
Respuesta aceptada
Más respuestas (2)
Engenuity
el 27 de Mzo. de 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 comentarios
Walter Roberson
el 27 de Mzo. de 2025
set(findall(groot, 'type', 'figure', '-and', 'WindowStyle', 'docked'), 'WindowStyle', 'normal')
No loop needed.
Engenuity
el 28 de Mzo. de 2025
🤜🏽🤛🏽
orsijafdsoij
el 28 de Mzo. de 2025
Walter Roberson
el 28 de Mzo. de 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
el 28 de Mzo. de 2025
Engenuity
el 1 de Abr. de 2025
I am not familiar with a programmatic way to dock the entire figure window.
orsijafdsoij
el 11 de Abr. de 2025
0 votos
Categorías
Más información sobre Graphics Object Properties en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!