Learn R Programming

itsadug (version 2.0)

alphaPalette: Manipulate the transparency in a palette.

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 b

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 Functions for plotting: addInterval, add_bars, alpha, check_normaldist, color_contour, dotplot_error, drawArrows, emptyPlot, errorBars, fadeRug, fill_area, getCoords, getFigCoords, getProps, gradientLegend, marginDensityPlot, plot_error, plot_image, plotsurface, rug_model

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