color_trans | R Documentation |
This function allows you to modify opaque colors you are already using and make transparent versions. It's handy for adding confidence bands around mean values.
color_trans(hexcolor, alpha = 0.25)
x |
numeric vector |
Nikolai Klibansky
## Not run:
n <- 7
myalpha <- 0.25
mycol <- rainbow(n) # Opaque rainbow
mycol_tr <- rainbow(n,alpha=myalpha) # Transparent rainbow using alpha argument
mycol_tr2 <- color_trans(mycol,alpha=myalpha) # Transparent rainbow modifing mycol, using alpha argument from color_trans
par(cex=2,pch=16)
plot(1:n,rep(1,n),col=mycol,ylim=c(0,5))
points(1:n,rep(2,n),col=mycol_tr)
points(1:n,rep(3,n),col=mycol_tr2)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.