Learn R Programming

itsadug (version 0.8)

alphaPalette: Utility function.

Description

Generate an color palette with changing transparency.

Usage

alphaPalette(x, f.seq, n = NULL)

Arguments

x
A vector with color values. Could be a single value specifying a single color palette, ranging in transparency values, or a vector with different colors.
f.seq
A vector with transparency values, ranging from 0 to 1.
n
Optional argument. A number specifying the number of colors in the palette. If n > 1, then N transparency values are generated ranging from the minimum of f.seq to the maximum of f.seq. n will only be us

Value

  • A vector with color values.

Warning

On Linux x11 devices may not support transparency. In that case, a solution might be to write the plots immediately to a file using functions such as pdf, or png.

See Also

palette, colorRampPalette, adjustcolor, convertColor

Other Utility functions for plotting: addInterval; alpha; dotplot_error; emptyPlot; errorBars; fadeRug; fill_area; find_difference; getCoords; gradientLegend; horiz_error; plot_error

Examples

Run this code
# a palette of 5 white transparent colors:
alphaPalette('white', f.seq=1:5/5)
# the same palette:
alphaPalette('white', f.seq=c(.2,1), n=5)
# a palette with 10 colors blue, yellow and red, that differ in transparency
alphaPalette(c('blue', "yellow", "red"), f.seq=c(0.1,.8), n=10)

Run the code above in your browser using DataLab