
Last chance! 50% off unlimited learning
Sale ends in
SetAlpha(col, alpha = 0.5)
colors()
) or an integer i meaning palette()[i]
.col
, giving the rgb-values extended by the alpha channel as hex-number (#rrggbbaa).ColToHex
, col2rgb
SetAlpha("yellow", 0.2)
SetAlpha(2, 0.5) # red
Canvas(3)
DrawCircle(x=c(-1,0,1), y=c(1,-1,1), radius=2, col=SetAlpha(2:4, 0.4))
x <- rnorm(15000)
par(mfrow=c(1,2))
plot(x, type="p", col="blue" )
plot(x, type="p", col=SetAlpha("blue", .2), main="Better insight with alpha channel" )
Run the code above in your browser using DataLab