scale_fill_chameleon {chameleon} | R Documentation |
Setup a fill scale of distinct discrete colors in ggplot2.
Description
This is a thin wrapper to ggplot2::discrete_scale('fill', '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.
Usage
scale_fill_chameleon(
minimal_saturation = 33,
minimal_lightness = 20,
maximal_lightness = 80,
...
)
Arguments
minimal_saturation |
Exclude colors whose saturation ( |
minimal_lightness |
Exclude colors whose lightnes ( |
maximal_lightness |
Exclude colors whose lightnes ( |
... |
Additional parameters for |
Examples
library(ggplot2)
data(pbmc)
frame <- as.data.frame(pbmc$umap)
frame$type <- pbmc$types
ggplot(frame, aes(x=xs, y=ys, fill=type)) +
geom_point(size=0.75, shape=21, color="black", stroke=0.1) +
scale_fill_chameleon() +
theme(legend.text=element_text(size=12), legend.key.height=unit(14, 'pt'))
[Package chameleon version 0.2-3 Index]