Borrar filtros
Borrar filtros

How to get the screen width?

8 visualizaciones (últimos 30 días)
Mr M.
Mr M. el 12 de Nov. de 2015
Comentada: Jan el 13 de Nov. de 2015
Is it possible to set outer position of a figure in normalized units (for example to be equal to 1), than get the width in other units (which has to be the screen width)?

Respuestas (2)

Stalin Samuel
Stalin Samuel el 12 de Nov. de 2015

Jan
Jan el 12 de Nov. de 2015
Editada: Jan el 13 de Nov. de 2015
Yes, simply try it:
FigH = figure('Units', 'normalized', 'Position', [0,0,1,1]);
drawnow; % Not sure if this is required
set(FigH, 'Units', 'inches');
inchPos = get(FigH, 'Position');
Note that the resolution of the screen matters for the result and this value is defined by the operating system. It could fail on Apple's Retina displays or Windows7 laptops with a userdefined scaling factor, most of all if the computer is connected to a projector.
  2 comentarios
Stephen23
Stephen23 el 12 de Nov. de 2015
Editada: Stephen23 el 12 de Nov. de 2015
Beamer -> Projector
"Beamer" is one of the cute words that Germans think is English but isn't really, just like "Handy" and "Oldtimer".
Jan
Jan el 13 de Nov. de 2015
@Stephen: Thanks, it's fixed now. I did neither talk about BMW motor cycles not about cricket.
I took the chance to improve my English by recognizing, that these terms are German: Drive-in, Pullover, Mobbing, Smoking, Streetworker, Basecap, Discounter, No-Go, Public Viewing.
Astonishing.

Iniciar sesión para comentar.

Categorías

Más información sobre Environment and Settings 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!

Translated by