Description Usage Arguments Value Warning Author(s) See Also Examples
Generate an color palette with changing transparency.
1 | alphaPalette(x, f.seq, n = NULL)
|
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 |
A vector with color values.
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.
Jacolien van Rij
palette, colorRampPalette,
adjustcolor, convertColor
Other Functions for plotting:
addInterval(),
add_bars(),
add_n_points(),
alpha(),
check_normaldist(),
color_contour(),
dotplot_error(),
drawDevArrows(),
emptyPlot(),
errorBars(),
fill_area(),
getCoords(),
getFigCoords(),
getProps(),
gradientLegend(),
legend_margin(),
marginDensityPlot(),
plot_error(),
plot_image(),
plotsurface(),
sortBoxplot()
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | # 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)
emptyPlot(1,1, axes=FALSE, main='Tunnel of 11 squares')
mycol <- 'steelblue'
center <- c(.75, .25)
i = seq(0,1,by=.1)
fillcol <- alphaPalette(c(mycol, 'black'), f.seq=i)
linecol <- alphaPalette(mycol, f.seq=1-i)
rect(center[1]-center[1]*(1.1-i), center[2]-center[2]*(1.1-i),
center[1]+(1-center[1])*(1.1-i), center[2]+(1-center[2])*(1.1-i),
col=fillcol, border=linecol, lty=1, lwd=1, xpd=TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.