Manipulate the transparency in a palette.
Generate an color palette with changing transparency.
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.
Jacolien van Rij
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()
# 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)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.