contourPlot | R Documentation |
Produces a contour plot or a colored surface with colors corresponding to
values in z
.
contourPlot(z, ...) ## Default S3 method: contourPlot(z, x, y, Grid = list(method = "interpolate", linear = TRUE, extrapolate = FALSE, density = 90, span = 0.75, degree = 1, family = "symmetric"), Contours = list(name = "Auto", levels = 10, filled = FALSE, lineColor = "black", lineLabel = "flattest", fillColors = "coolWarm"), yaxis.range = c(NA, NA), xaxis.range = c(NA, NA), ylabels = 4, xlabels = 4, xtitle = deparse(substitute(x)), ytitle = deparse(substitute(y)), caption = "", margin = c(NA, NA, NA, NA), ...) ## S3 method for class 'matrix' contourPlot(z, rows, cols, matrix.rows = "x", Contours = list(name = "Auto", levels = 10, filled = FALSE, lineColor = "black", lineLabel = "flattest", fillColors = "coolWarm"), yaxis.range = c(NA, NA), xaxis.range = c(NA, NA), ylabels = 4, xlabels = 4, xtitle = deparse(substitute(x)), ytitle = deparse(substitute(y)), caption = "", margin = c(NA, NA, NA, NA), ...)
z |
the values representing the surface data. |
... |
not used, required for other methods. |
x |
the x-axis coordinates for each value in |
y |
the y-axis coordinates for each value in |
Grid |
control parameters for gridding irregularly spaced data. See Details. |
Contours |
control parameters for the coutour lines or levels in the filled plot. See Details. |
yaxis.range |
set the range of the y-axis. |
xaxis.range |
set the range of the x-axis. |
ylabels |
set up y-axis labels. See |
xlabels |
set up x-axis labels. See |
xtitle |
the x-axis title (also called x-axis caption). |
ytitle |
the y-axis title (also called y-axis caption). |
caption |
the figure caption. |
margin |
set the plot area margins, in units of lines of text. Generally
all NA or the output from |
rows |
the coordinates for |
cols |
the coordinates for |
matrix.rows |
a single character, either "x" or "y" indicating whether the rows in z should be plotted along the x or y axis. |
Missing values are permitted in z
, x
, and y
for the default
method and are removed, with a warning. before constructing the surface. Duplicated values,
identical x
and y
, are not permitted and generate an error.
Missing values are not permitted in rows
or columns
but are permitted
in z
for the matrix method. Missing values in z
result in blank areas
in the plot.
The Grid
argument must be a tagged list with these components:
The method to use for constructung the grid. Must be either "interpolate"
or "loess." If "interpolate," then the z
values are interpolated directly from the
x
and y
values. If "loess," then the z
values are smoothed prior to
interpolation
Logical, if TRUE
, then use linear interpolation, if FALSE
, then
use spline interpolation.
Logical, if TRUE
, then extrapolate to the limits of the grid, if
FALSE
, then do not extrapoalte outsite of the hull of the data values.
The density of the grid—the number of cells along x
and y
.
The span
argument for loess
if method
is "loess."
The degree
argument for loess
if method
is "loess."
The family
argument for loess
if method
is "loess."
#'The Contour
argument must be a tagged list with these components:
The name to use to describe the contours. If "Auto" and filled
is
TRUE
, then the descripotion is blank. If "Auto" and filled
is FALSE
,
the the description is Line of equal value." In all other cases, the description is the
text assigned to name
.
Either the number of levels of contours or a vector of the desired contour levels.
Logical, if TRUE
, then draw filled contours, if FALSE
, then
only contour lines are drawn.
The color to draw the contour lines. Can be set to "none" to supress drawing lines for filled contours.
A character string indicating how to draw the labels on the contours. May be
"none" to supress draing the labels, or any valid value for the method
argument
to contour
.
The prefix corresponding to a color ramp generating function, like "warmCool"
for the warmCool.colors
function.
Information about the graph.
## Not run: set.seed(1) Xbig <- runif(100) Ybig <- runif(100) # Make a hill Zbig <- 1 - ((Xbig-.5)^2 + (Ybig-.5)^2)^.75 setGD() contourPlot(Zbig, Xbig, Ybig) # See for examples of contourPlot see vignette(topic="GraphGallery", package="smwrGraphs") ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.