Description Usage Arguments Value Author(s) Examples
Associates nominal values with a set of colors.
1 |
x |
Vector of character strings. |
classes |
Vector of character strings defining the class names.
Typically, this would be |
colors |
Vector of colors corresponding to |
warn |
Warn if |
NAcolor |
Color used for |
A vector of colors of the same length as x
.
David Kneis david.kneis@tu-dresden.de
1 2 3 4 5 6 7 8 9 10 | classes=c("A","B","C")
colors=c("red","blue","green")
x= runif(1000) * 100
y= runif(length(x)) * 100
z= rep("A", length(x))
z[x*y > 50] = "B"
z[x*y > 500] = "C"
z[x*y > 5000] = "D"
plot(x, y, col=colorQual(z, classes, colors, NAcolor="grey"))
legend("topright", bg="white", pch=1, col=colors, legend=classes)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.