View source: R/scale-categorical.r
sccolour | R Documentation |
Continuous variables will automatically be converted to categorical
using chop_auto
. You may want to use chop
to convert the values yourself for finer control.
sccolour(plot, name = "", h = c(0, 360), l = 65, c = 100, alpha = 1)
sccolor(plot, name = "", h = c(0, 360), l = 65, c = 100, alpha = 1)
scfill(plot, name = "", h = c(0, 360), l = 75, c = 100, alpha = 1)
plot |
ggplot object |
name |
name of the scale (used in the legend) |
h |
range of hues to use |
l |
luminance value |
c |
chroma value |
alpha |
alpha value |
This scale is automatically added when you have colour in your list of aesthetics. For finer control, you will need to set the scale yourself. See the example for some ideas.
p <- ggplot(reshape::tips, aes = list(x = day, y = tip))
ggjitter(p)
ggjitter(p, list(colour=sex))
ggjitter(p, list(colour=chop(tip, 3)))
sccolour(ggjitter(p, list(colour=chop(tip, 3))), l = 40)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.