How to put a figure window in the center of the screen?
160 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Merse Gaspar
el 27 de Mayo de 2023
Comentada: Merse Gaspar
el 28 de Mayo de 2023
Is it possible to put a figure (for example a GUI window) in the center of the screen? How to get screen size in pixels, or how to measure position not from the bottom, but from the top?
0 comentarios
Respuesta aceptada
Atsushi Ueno
el 27 de Mayo de 2023
width = 640; height = 480;
Pix_SS = get(0,'screensize')
[(Pix_SS(3)-width)/2 (Pix_SS(4)-height)/2 width height]
figure('Position', [(Pix_SS(3)-width)/2 (Pix_SS(4)-height)/2 width height])
3 comentarios
Walter Roberson
el 27 de Mayo de 2023
Historically, 0 was used to refer to the "root" of the handle graphics system -- the object that is the parent of all figures (and other figure-like graphics objects.)
These days, using groot is the preferred way to refer to the root of the graphics system. (There are a small number of differences between using 0 and using groot() that most people would never notice)
Ver también
Categorías
Más información sobre Dialog Boxes en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!