plot.raster | R Documentation |
This functions implements a plot
method for raster images.
## S3 method for class 'raster' plot(x, y, xlim = c(0, ncol(x)), ylim = c(0, nrow(x)), xaxs = "i", yaxs = "i", asp = 1, add = FALSE, ...)
x, y |
raster. |
xlim, ylim |
Limits on the plot region (default from dimensions of the raster). |
xaxs, yaxs |
Axis interval calculation style (default means that raster fills plot region). |
asp |
Aspect ratio (default retains aspect ratio of the raster). |
add |
Logical indicating whether to simply add raster to an existing plot. |
... |
Further arguments to the |
plot.default
, rasterImage
.
require(grDevices) r <- as.raster(c(0.5, 1, 0.5)) plot(r) # additional arguments to rasterImage() plot(r, interpolate=FALSE) # distort plot(r, asp=NA) # fill page op <- par(mar=rep(0, 4)) plot(r, asp=NA) par(op) # normal annotations work plot(r, asp=NA) box() title(main="This is my raster") # add to existing plot plot(1) plot(r, add=TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.