gradient.legend: Create a gradiented legend

Description Usage Arguments Author(s) See Also Examples

Description

Create a gradiented legend

Usage

1
2
gradient.legend(y = NULL, yrange = NULL, cols = c("red", "blue"),
  location = c(0.075, 0.3, 0.575, 0.975), n = 100, ...)

Arguments

y

the variable used to create the gradient, typically in number.to.colors

yrange

The range of y values. If y is supplied, it will pulls these from the actual y values.

cols

The color gradients to be used that are passed to colorRampPalette.

location

The location of the subplot, expressed in fractions of the entire plot (left x, right x, bottom y, top y).

n

the number of values used for the gradient. Higher numbers make a higher resolution

...

other arguments passed to image

Author(s)

Dustin Fife

See Also

number.to.colors colorRampPalette

Examples

1
2
3
4
y = rnorm(100); x = .6*y + rnorm(100,0,sqrt(1-.6^2))
randnum = runif(100)
plot(x,y, col=number.to.colors(randnum), pch=16)
gradient.legend(randnum, xlab="", ylab="")

vagnerfonseca/fifer documentation built on May 3, 2019, 4:06 p.m.