How to check if the Figures window is docked and to undock it
Mostra commenti meno recenti
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.
Risposta accettata
Più risposte (2)
Engenuity
il 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 Commenti
Walter Roberson
il 27 Mar 2025
set(findall(groot, 'type', 'figure', '-and', 'WindowStyle', 'docked'), 'WindowStyle', 'normal')
No loop needed.
Engenuity
il 28 Mar 2025
🤜🏽🤛🏽
orsijafdsoij
il 28 Mar 2025
Walter Roberson
il 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
il 28 Mar 2025
Engenuity
il 1 Apr 2025
I am not familiar with a programmatic way to dock the entire figure window.
orsijafdsoij
il 11 Apr 2025
0 voti
Categorie
Scopri di più su Graphics Object Properties in Centro assistenza e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!