layer_contourf: layer of contourf

View source: R/layer_contourf.R

layer_contourfR Documentation

layer of contourf

Description

layer of contourf

Usage

layer_contourf(
  at = NULL,
  col = NULL,
  col.regions = NULL,
  contour = TRUE,
  region = FALSE,
  labels = FALSE,
  label.style = c("mixed", "flat", "align"),
  format = "%f",
  ...
)

Arguments

at

Numeric vector giving breakpoints along the range of z. See levelplot for details.

col.regions

A vector of colors, or a function to produce a vecor of colors, to be used if region=TRUE. Each interval defined by at is assigned a color, so the number of colors actually used is one less than the length of at. See level.colors for details on how the color assignment is done.

contour

A logical flag, specifying whether contour lines should be drawn.

region

A logical flag, specifying whether inter-contour regions should be filled with appropriately colored rectangles.

labels

Either a logical scalar indicating whether the labels are to be drawn, or a character or expression vector giving the labels associated with the at values. Alternatively, labels can be a list with the following components:

labels:

a character or expression vector giving the labels. This can be omitted, in which case the defaults will be used.

col, cex, alpha:

graphical parameters for label texts

fontfamily, fontface, font:

font used for the labels

label.style

Controls how label positions and rotation are determined. A value of "flat" causes the label to be positioned where the contour is flattest, and the label is not rotated. A value of "align" causes the label to be drawn as far from the boundaries as possible, and the label is rotated to align with the contour at that point. The default is to mix these approaches, preferring the flattest location unless it is too close to the boundaries.

...

other parameters to lattice::panel.levelplot()

Note

  • the parameter brks was renamed as at

See Also

lattice::panel.levelplot()

Examples

cols <- get_color("Blues")

print(lattice(z ~ x * y, dvolcano) +
    layer_contourf(
        labels = TRUE, format = "%.0f",
        col = "black", lwd = 0.2, lty = 2, region = FALSE))
print(lattice(z ~ x * y, dvolcano) +
    layer_contourf(labels = TRUE, format = "%.0f", col = cols, region = FALSE))

print(lattice(z ~ x * y, dvolcano) +
    layer_contourf(labels = TRUE, format = "%.0f", region = FALSE))

print(lattice(z ~ x * y, dvolcano) +
    layer_contourf(labels = TRUE, format = "%.1f", region = TRUE))

kongdd/latticeGrob documentation built on March 30, 2024, 3:35 a.m.