Thanks again
Ray
On 10/15/12 6:32 PM, Simon Urbanek wrote:
Ray,
On Oct 15, 2012, at 8:57 PM, Ray Spence wrote:
All,
There seems to be something wrong between OS X 10.7.5 and how
quartz reads Apple graphics resolution on 24" iMac (early 2008,
iMac8,1) on R 2.15.1 GUI1.52. On this hardware/OS/R version the
default R plot is a rectangle.
Can you attach a screenshot? R is simply reading the geometry reported by the OS to adjust the aspect ratio accordingly.
Can you run this in R:
install.packages("inline") # if you don't have inline installed yet
library(inline)
f=cfunction(,'CGDirectDisplayID md = CGMainDisplayID(); CGSize ds = CGDisplayScreenSize(md); Rprintf("%gmm x %gmm\\n", ds.width, ds.height); return ScalarReal(ds.width / ds.height);','#include <ApplicationServices/ApplicationServices.h>')
f()
You should see this on a 24" iMac8,1:
520mm x 320mm
[1] 1.625
Those are the proper dimensions of the built-in screen.
If that's not what you get, you should be able work around this by setting dpi manually to 94 (it will be slightly off since the native dpi is asymmetric 93.785 x 95.25 but 94 should be close enough to not notice) - either in quartz.options() or quartz().
Cheers,
Simon
On same hardware/R version running
OS X 10.7.4 the default R plot is square as expected. (I don't see
this behavior on 20" iMac once upgraded to 10.7.5.)
On this problematic iMac, if I run quartz.options() without changing
anything I see:
$title
[1] "Quartz %d"
$width
[1] 7
$height
[1] 7
$pointsize
[1] 12
$family
[1] "Helvetica"
$fontsmooth
[1] TRUE
$antialias
[1] TRUE
$type
[1] "native"
$bg
[1] "transparent"
$canvas
[1] "white"
$dpi
[1] NA
But any plot, eg.
plot (rnorm(10),rnorm(10))
returns an image that is most definitely not a square.
Can anyone help me investigate this? For instance where/how
does R create the plot graphic? Are there specific OS X file(s) that R
reads to generate the plots?
My assumption is that this is an Apple Inc. generated problem
but figured that the R community might be a bit more responsive..
Thanks,
Ray
--
*******************
Raymond Spence
U.C. Berkeley
Dept. of Statistics
SCF Sysadmin
497 Evans Hall
U.C. Berkeley
510.642.5497