powered by
Setting transparency in base graphics is not as easy as in Lattice, so here's a little functon to help.
Lattice
transparentColorBase(color, alphaTrans = alphaTrans)
The color, or a vector of colors from colors().
colors()
The alpha transparency value between [0,1] with 0 opaque and 1 fully transparent.
The rgb value(s), which can be passed to any base graphics routine to get transparency.
As above.
col2rgb, rgb
col2rgb
rgb
# NOT RUN { cols = transparentColorBase('red', alphaTrans=c(0.3,0.6,0.9)) symbols(c(1,1.5,2), c(1,1.5,2), circles=rep(1,3), bg=cols, xlim=c(0,4), ylim=c(0,4)) # }
Run the code above in your browser using DataLab