| scale_color_chameleon | R Documentation |
This is a thin wrapper to ggplot2::discrete_scale('colour', 'chameleon', ...), which uses
the colors chosen by invoking distinct_colors. The order of the colors is arbitrary. If
the data has some structure the colors should reflect, use one of the many palettes available in
R, or using data_colors for automatically matching the colors to the structure of
multi-dimensional data.
scale_color_chameleon( minimal_saturation = 33, minimal_lightness = 20, maximal_lightness = 80, ... )
minimal_saturation |
Exclude colors whose saturation ( |
minimal_lightness |
Exclude colors whose lightnes ( |
maximal_lightness |
Exclude colors whose lightnes ( |
... |
Additional parameters for |
library(ggplot2)
data(pbmc)
frame <- as.data.frame(pbmc$umap)
frame$type <- pbmc$types
ggplot(frame, aes(x=xs, y=ys, color=type)) +
geom_point(size=0.75) +
scale_color_chameleon() +
theme(legend.text=element_text(size=12), legend.key.height=unit(14, 'pt'))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.