The R Project SVN R

Rev

Rev 68948 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
67197 murrell 1
% File src/library/graphics/man/plotraster.Rd
68948 ripley 2
% Part of the R package, https://www.R-project.org
67599 ripley 3
% Copyright 1995-2014 R Core Team
67197 murrell 4
% Distributed under GPL 2 or later
5
 
6
\name{plot.raster}
7
\title{Plotting Raster Images}
8
\usage{
9
\method{plot}{raster}(x, y,
10
     xlim = c(0, ncol(x)), ylim = c(0, nrow(x)),
11
     xaxs = "i", yaxs = "i",
12
     asp = 1, add = FALSE, \dots)
13
}
14
\alias{plot.raster}
15
\arguments{
16
  \item{x, y}{raster. \code{y} will be ignored.}
17
  \item{xlim, ylim}{Limits on the plot region (default from dimensions
74363 maechler 18
    of the raster).}
67197 murrell 19
  \item{xaxs, yaxs}{Axis interval calculation style (default means that
74363 maechler 20
    raster fills plot region).}
67197 murrell 21
  \item{asp}{Aspect ratio (default retains aspect ratio of the raster).}
22
  \item{add}{Logical indicating whether to simply add raster to an
23
    existing plot.}
24
  \item{\dots}{Further arguments to the \code{\link{rasterImage}} function.}
25
}
26
\description{
27
  This functions implements a \code{\link{plot}} method for raster images.
28
}
29
\seealso{
30
    \code{\link{plot.default}}, \code{\link{rasterImage}}.
31
}
32
\examples{
33
require(grDevices)
34
r <- as.raster(c(0.5, 1, 0.5))
35
plot(r)
36
# additional arguments to rasterImage()
37
plot(r, interpolate=FALSE)
38
# distort
39
plot(r, asp=NA)
40
# fill page
41
op <- par(mar=rep(0, 4))
42
plot(r, asp=NA)
43
par(op)
44
# normal annotations work
45
plot(r, asp=NA)
46
box()
47
title(main="This is my raster")
48
# add to existing plot
49
plot(1)
50
plot(r, add=TRUE)
51
}
52
\keyword{hplot}