draw horizontal and vertical polygons

draw_polygon(
  vals,
  x = NULL,
  type = "horizontal",
  length.out = 10000,
  col.regions = c("blue", "red"),
  alpha = 0.6,
  zlim = c(-Inf, Inf),
  ...
)

Arguments

vals

numeric vector

x

The corresponding x position of vals

type

one of "horizontal" or "vertical"

length.out

the length of interpolated vals and x

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.

alpha

the alpha of polygon's fill color

zlim

limits of vals

...

Extra parameters.

Examples

set.seed(1)
y <- rnorm(10)
x <- seq_along(y)