[R] par("din") vs dev.size()

From: Sarah Goslee <sarah.goslee_at_gmail.com>
Date: Fri, 18 Jul 2008 12:37:53 -0400


Hello,

I was messing around with graphics, and noted an odd behavior of par("din"). If the x11 device is empty, par("din") does not return the correct size if the device
has been resized manually. dev.size() works correctly.

R version 2.7.1; Fedora 8

# case 1 - empty device

> x11()
> dev.size()

[1] 6.995263 6.994187
> par("din")

[1] 6.995263 6.994187

# resize device
> dev.size()

[1] 6.995263 3.401667
> par("din")

[1] 6.995263 6.994187
> dev.off()

# case 2, device containing a plot

> x11()
> plot(1,1)
> dev.size()

[1] 6.995263 6.994187
> par("din")

[1] 6.995263 6.994187

# resize device
> dev.size()

[1] 6.995263 2.772976
> par("din")

[1] 6.995263 2.772976
> dev.off()

I found some discussion of this from 2000 and 2001, but no explanation or resolution, and I'm curious. Is there a reason for this behavior?

Thanks,
Sarah

-- 
Sarah Goslee
http://www.functionaldiversity.org

______________________________________________
R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Received on Fri 18 Jul 2008 - 17:59:01 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Mon 21 Jul 2008 - 12:32:02 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive