Description Usage Arguments Examples
A function to change the alpha value (transparency) of colours that are defined as strings.
1 |
colours |
A vector of colours defined by strings of characters |
alphas |
The transparency (0=transparent, 1=opaque) |
1 2 3 4 5 6 7 8 9 10 | # Define the coordinates of three points
x <- c(0.2, 0.5, 0.8)
y <- c(0.5, 0.5, 0.5)
# Define the colours for the points
colours <- c("green", "blue", "red")
# Plot the points - set the transparency
plot(x, y, bty="n", xlab="X", ylab="Y", las=1, pch=19, cex=30, xlim=c(0,1), ylim=c(0,1),
col=setAlpha(colours, alpha=0.5))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.