# NOT RUN {
plot(iris[, c("Petal.Length", "Petal.Width")], pch = 21,
bg = factor2color(iris$Species))
legend("topleft", legend = levels(iris$Species),
fill = factor2color(as.factor(levels(iris$Species))))
# }
Run the code above in your browser using DataLab