David Romano
David Romano

Reputation: 157

How does grid determine xscale and yscale values in a new R session and how should they be interpreted?

When I start an R session, the xscale and yscale values of the initial viewport are set automatically by the grid package. I would like to understand the relationship between these values and the corresponding screen dimensions in pixels.

These are the results I get when I run the same code from RStudio with reprex:

library(grid)
convertY(unit(0, 'npc'), "native")
#> [1] 360native

Created on 2024-04-24 with reprex v2.0.2

and from the R app:

library(grid)
convertY(unit(0, 'npc'), "native")
#> [1] 504native

both immediately after starting an a new R session.

What I would like to know is :

  1. what lead to these values being different, and
  2. what relation do these values bear to screen dimensions

Upvotes: 1

Views: 65

Answers (0)

Related Questions