contour.plot: Display contours

View source: R/colour.R

contour.plotR Documentation

Display contours

Description

Create a filled or unfilled contour plot.

Usage

## S3 method for class 'plot'
contour(
  x,
  y,
  z,
  fill = F,
  levels = NULL,
  nlevels = if (is.null(levels)) 4 else length(levels),
  level.data = z,
  zlim,
  equal = F,
  pretty = T,
  lwd = 2,
  drawlabels = F,
  color.palette = YlGnBu.colors,
  bg = grey(0.65),
  key = T,
  zlab = "",
  ...
)

Arguments

x, y

locations at which the values in z are measured.

z

a matrix containing the values to be plotted (NAs are allowed).

fill

If TRUE, makes a filled contour plot.

levels

numeric vector of levels at which to draw contour lines. The next few arguments only apply to the case when levels==NULL.

nlevels

The number of contour lines to draw.

level.data

numeric vector to use for computing levels.

zlim

The range that the levels should cover. Defaults to the range of level.data.

equal

If TRUE, the levels are equally spaced over zlim. Otherwise they match the quantiles of level.data.

pretty

If TRUE, the levels are chosen to be round numbers.

lwd

width of the contour lines.

drawlabels

If TRUE, the contour lines are labeled with their level.

color.palette

a vector of colors, or a function which takes a number and returns a vector of that length.

bg

the background color.

key

If TRUE, a color key is drawn at the top of the plot. If key==2, the key of filled.contour is used.

...

extra arguments passed to contour or filled.contour.

main

the title of the plot.

Details

This is a wrapper function for contour and filled.contour whose main purpose is to provide a uniform interface and provide a decent automatic choice of levels.

If equal=FALSE, the levels are chosen according to the equal-count algorithm of break.quantile.

Author(s)

Tom Minka

See Also

contour,filled.contour, color.plot.loess

Examples


# see the examples for color.plot.loess


paulemms/datamining documentation built on March 1, 2023, 4:01 p.m.