Description Usage Arguments Examples
Uses color brewer qualitative Set1 (without the yellow) for data with up to 8 levels and the default ggplot2 color scale otherwise.
1 |
... |
common discrete scale parameters: |
1 2 3 4 5 6 7 8 9 10 | d <- diamonds[sample(nrow(diamonds), 5000), ]
p <- ggplot(d, aes(carat, price))
# fewer than 9 levels
p + geom_point(aes(color = cut(price, breaks = 4))) + auto_color()
p + geom_point(aes(color = cut(price, breaks = 8))) + auto_color()
# more than 8 levels
p + geom_point(aes(color = cut(price, breaks = 9))) + auto_color()
p + geom_point(aes(color = cut(price, breaks = 50))) + auto_color(guide = FALSE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.