Martijn Tennekes
2022-Mar-02 09:52 UTC
[R] dev.size() does not return correct size on 4K screen
dev.size() does not return the correct screen size when using a 4K screen. With the R console and a x11() device, it seems to overestimate with factor 1.5, and in RStudio underestimate with factor 2. See also https://github.com/rstudio/rstudio/issues/10723 Is this a bug, or is there something I can do? Best, Martijn Tennekes [[alternative HTML version deleted]]
peter dalgaard
2022-Mar-02 22:11 UTC
[R] dev.size() does not return correct size on 4K screen
I don't know about RStudio, but in X11 this sort of thing can happen due to misconfiguration of the display itself, i.e. not in R as such. Basically, it relies on getting the correct dots-per-inch value from the display, and may otherwise use some standard value. What happens if you run xdpyinfo in a terminal window? With XQuartz on an MB Air, I see ... screen #0: dimensions: 1440x876 pixels (381x232 millimeters) resolution: 96x96 dots per inch ... which is a multi-way lie! It is a 2560x1600 retina display, the resolution is way higher than 96x96, and it is 13.3", whereas the stated dimensions corresponds to a 17" diagonal. However, systems may be "lying in the users best interest", since e.g. the default for an X11() plot window is 7in square, which might not fit on a small laptop. You are somewhat more likely to want the same relative size across different laptops. - pd> On 2 Mar 2022, at 10:52 , Martijn Tennekes <mtennekes at gmail.com> wrote: > > dev.size() does not return the correct screen size when using a 4K > screen. With the R console and a x11() device, it seems to overestimate > with factor 1.5, and in RStudio underestimate with factor 2. > > See also https://github.com/rstudio/rstudio/issues/10723 > > Is this a bug, or is there something I can do? > > Best, > > Martijn Tennekes > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > 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.-- Peter Dalgaard, Professor, Center for Statistics, Copenhagen Business School Solbjerg Plads 3, 2000 Frederiksberg, Denmark Phone: (+45)38153501 Office: A 4.23 Email: pd.mes at cbs.dk Priv: PDalgd at gmail.com