When grid package is used to plot a figure, I want to find out something similar to par('usr') as in base R graphics. What command can do it?
https://r-graph-gallery.com/100-high-density-scatterplot-with-binning.html
For example, how to get the value equivalent to par('usr') in the following figure?
library(hexbin)
library(RColorBrewer)
# Create data
x <- rnorm(mean=1.5, 5000)
y <- rnorm(mean=1.6, 5000)
# Make the plot
bin<-hexbin(x, y, xbins=40)
my_colors=colorRampPalette(rev(brewer.pal(11,'Spectral')))
plot(bin, main="" , colramp=my_colors , legend=F ) # the plot is based on grid if I understand it correctly.