The R Project SVN R

Rev

Rev 59039 | Rev 64662 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 59039 Rev 61433
Line 34... Line 34...
34
  }
34
  }
35
  \item{x}{A numeric vector or unit object specifying x-location.}
35
  \item{x}{A numeric vector or unit object specifying x-location.}
36
  \item{y}{A numeric vector or unit object specifying y-location.}
36
  \item{y}{A numeric vector or unit object specifying y-location.}
37
  \item{width}{A numeric vector or unit object specifying width.}
37
  \item{width}{A numeric vector or unit object specifying width.}
38
  \item{height}{A numeric vector or unit object specifying height.}
38
  \item{height}{A numeric vector or unit object specifying height.}
39
  \item{just}{The justification of the rectangle 
39
  \item{just}{The justification of the rectangle
40
    relative to its (x, y) location.  If there are two values, the first
40
    relative to its (x, y) location.  If there are two values, the first
41
    value specifies horizontal justification and the second value specifies
41
    value specifies horizontal justification and the second value specifies
42
    vertical justification.  Possible string values are: \code{"left"},
42
    vertical justification.  Possible string values are: \code{"left"},
43
    \code{"right"}, \code{"centre"}, \code{"center"}, \code{"bottom"},
43
    \code{"right"}, \code{"centre"}, \code{"center"}, \code{"bottom"},
44
    and \code{"top"}.  For numeric values, 0 means left alignment
44
    and \code{"top"}.  For numeric values, 0 means left alignment
Line 48... Line 48...
48
    If specified, overrides the \code{just} setting.}
48
    If specified, overrides the \code{just} setting.}
49
  \item{vjust}{A numeric vector specifying vertical justification.
49
  \item{vjust}{A numeric vector specifying vertical justification.
50
    If specified, overrides the \code{just} setting.}
50
    If specified, overrides the \code{just} setting.}
51
  \item{default.units}{A string indicating the default units to use
51
  \item{default.units}{A string indicating the default units to use
52
    if \code{x}, \code{y}, \code{width}, or \code{height}
52
    if \code{x}, \code{y}, \code{width}, or \code{height}
53
    are only given as numeric vectors.}  
53
    are only given as numeric vectors.}
54
  \item{name}{ A character identifier. }
54
  \item{name}{ A character identifier. }
55
  \item{gp}{An object of class \code{gpar}, typically the output
55
  \item{gp}{An object of class \code{gpar}, typically the output
56
    from a call to the function \code{gpar}.  This is basically
56
    from a call to the function \code{gpar}.  This is basically
57
    a list of graphical parameter settings.}
57
    a list of graphical parameter settings.}
58
  \item{vp}{A Grid viewport object (or NULL).}
58
  \item{vp}{A Grid viewport object (or NULL).}
Line 65... Line 65...
65
\details{
65
\details{
66
  Neither \code{width} nor \code{height} needs to be specified,
66
  Neither \code{width} nor \code{height} needs to be specified,
67
  in which case, the aspect ratio of the image is preserved.  If
67
  in which case, the aspect ratio of the image is preserved.  If
68
  both \code{width} and \code{height} are specified, it is likely
68
  both \code{width} and \code{height} are specified, it is likely
69
  that the image will be distorted.
69
  that the image will be distorted.
70
  
70
 
71
  Not all graphics devices are capable of rendering raster images
71
  Not all graphics devices are capable of rendering raster images
72
  and some may not be able to produce rotated images (i.e., if
72
  and some may not be able to produce rotated images (i.e., if
73
  a raster object is rendered within a rotated viewport).
73
  a raster object is rendered within a rotated viewport).
74
  
74
 
75
  All graphical parameter settings in \code{gp} will be ignored,
75
  All graphical parameter settings in \code{gp} will be ignored,
76
  including \code{alpha}.
76
  including \code{alpha}.
77
}
77
}
78
\value{
78
\value{
79
  A rastergrob grob.
79
  A rastergrob grob.
Line 87... Line 87...
87
  \code{\link{dev.capabilities}} to see if it is supported.
87
  \code{\link{dev.capabilities}} to see if it is supported.
88
}
88
}
89
\examples{
89
\examples{
90
redGradient <- matrix(hcl(0, 80, seq(50, 80, 10)),
90
redGradient <- matrix(hcl(0, 80, seq(50, 80, 10)),
91
                      nrow=4, ncol=5)
91
                      nrow=4, ncol=5)
92
# interpolated 
92
# interpolated
93
grid.newpage()
93
grid.newpage()
94
grid.raster(redGradient)
94
grid.raster(redGradient)
95
# blocky
95
# blocky
96
grid.newpage()
96
grid.newpage()
97
grid.raster(redGradient, interpolate=FALSE)
97
grid.raster(redGradient, interpolate=FALSE)