When I want to get a quick look at a graph in RStudio, I typically use just plot(r)
or perhaps add a title with plot(r, main = title)
. When I'm doing a plot of a global raster data set, the xy min and max values in the Plots pane vary depending on the pane size. I'd like to do some plots where the plot size and dimensions are fixed; in particular, to xmin = - 150, xmax = 150, ymin = -90, ymax = 90
. It seems like the par("usr") option would be what to use.
Here's a simple example that shows what my problem is
b <- brick(system.file("external/rlogo.grd", package="raster"))
plot(b$red)
par("usr")
par(usr = c(-180, 180, -60, 90))
par("usr")
plot(b$green)
par("usr")
Every time I do a plot, the par usr value reverts to something else
Setting xlim and ylim as suggested acts a bit as clipping, but I'd also like to fix the usr values and get plot to accept them.
par
will let you change physical size but what you are asking for is what the xlim and ylim parameters toplot
are used for. – IRTFM