R convert grid units of layout object to native
问题 My problem is somewhat related to Convert units from npc to native using grid in R . I'm trying to figure out the location of certain plot elements start in a ggplot2 object (axes, main plot, etc). I found the following code: rm(list = ls()) library(ggplot2) library(grid) library(gtable) # a dummy plot g <- ggplot(cars, aes(x = speed, y = dist)) + geom_point() g # a layout of each element obj <- ggplotGrob(g) l <- gtable:::gtable_layout(obj) grid:::grid.show.layout(l) All the information I