How to check if the Figures window is docked and to undock it
    14 visualizaciones (últimos 30 días)
  
       Mostrar comentarios más antiguos
    
    orsijafdsoij
 el 27 de Mzo. de 2025
  
    
    
    
    
    Respondida: orsijafdsoij
 el 11 de Abr. de 2025
            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.  
0 comentarios
Respuesta aceptada
  Les Beckham
      
 el 1 de Abr. de 2025
        The following two commands will undock the Figures window in 2024b and earlier:
desktop = com.mathworks.mde.desk.MLDesktop.getInstance;
desktop.setGroupDocked('Figures', false);
5 comentarios
  Les Beckham
      
 el 2 de Abr. de 2025
				@Walter Roberson - That's true. Nevertheless, it is a legitimate concern that this undocumented way of controlling the docking status of the Figures window may break in future releases.
@orsijafdsoij - thanks for accepting the answer!
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
  Engenuity
 el 1 de Abr. de 2025
				I am not familiar with a programmatic way to dock the entire figure window.
Ver también
Categorías
				Más información sobre Environment and Settings en Help Center y File Exchange.
			
	Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!



