Learn R Programming

geotopbricks (version 1.5.3)

color.bar: Graphic Representation of a Color bar, function written by John Colby

Description

Graphic Representation of a Color bar, function written by John Colby

Usage

color.bar(lut, min, max = -min, nticks = 11, ticks = seq(min, max,
  len = nticks), title = "", width = 1.75, height = 5,
  ncolmax = 100, digits = 4, pdf = NULL)

Arguments

width, height

width and height of the device

ncolmax

maximum number of colors. Default is 100.

digits

specified number of significant digits

pdf

character value for pdf output file. Default is NULL and no pdf file is created.

References

http://stackoverflow.com/questions/9314658/colorbar-from-custom-colorramppalette

Examples

Run this code
# NOT RUN {
color.bar(colorRampPalette(c("light green", "yellow", "orange", "red"))(100), -1)



# }

Run the code above in your browser using DataLab