Skip to content

sizing of quartz and x11 windows

4 messages · stefano iacus, Parlamis Franklin, Simon Urbanek

#
whenever i open an x11 or quartz window, the dimensions of the window  
are roughly 74% and 72%, respectively, of what i call for.  for example:

quartz(width=3, height=4) leads to a window that is roughly 2.15  
inches by 2.9 inches, and
x11(width=3, height=4) leads to a window that is roughly 2.21 inches  
by 3 inches

i am using dual apple cinema 23" displays set at the 1920x1200  
resolution.

can anyone point me in the direction of understanding why this is  
happening?
#
The general answer is that your pixels are not squares but they are  
vertical rectangles, so what you expect is not what you see.
As for the small difference in quartz vs x11 I think is because of  
the resizing square at the bottom-right of the quartz window. So you  
should measure up to that square and you should get the same height.
You should notice this effect by creating 3x3 window and look that  
indeed it appears as a rectangle.
hope this helps
stefano
On Dec 5, 2005, at 5:28 AM, Parlamis Franklin wrote:

            
#
quartz(w=3,h=3) gives me a 2 6/32" square window (not including the  
banner, but including the resizing square).

the measured discrepency between x11 and quartz seems to scale  
linearly with the size of the windows (an x11 window being 1/64, 6/64  
and 12/64" bigger in the 1, 3 and 6" cases), but for both x11 and  
quartz the resizing square is within the measured square region, so i  
am not sure the resizing square is the source of the discrepency.

i am more wondering why 3" in the function call turns into 2 6/32"  
displayed.  is this a standard error for everyone, or is it just my  
monitor/card-combo that creates it?  and if it's standard, why have a  
function that purports to deliver a measurement?
On Dec 4, 2005, at 11:42 PM, stefano iacus wrote:

            
#
On Dec 5, 2005, at 5:36 PM, Parlamis Franklin wrote:

            
The discrepancy comes from the fact that the DPI density is not  
necessarily calibrated exactly to your monitor. I don't remember what  
Quartz uses (it is initialized to 72dpi, but I see no code that  
changes it later), but the DPI for X11 is usually set to an arbitrary  
default of 75 or 100 (see xdpyinfo|grep resol) which may not match  
your display (in fact my 23" Apple display has 99.5x98.3 DPI  
according to OS X so Apple knows what they're doing). You can use the  
-dpi argument to specify your real DPI in X11. As of Quartz, unless  
there is a way to set ipr in R directly I don't think you can change  
it. Given that most modern displays have at least 100dpi, I'd vote to  
change the Quartz default to 100...

Cheers,
Simon