sccolour: Scale: categorical colour Create a scale for categorical...

Description Usage Arguments Details Examples

View source: R/scale-categorical.r

Description

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.

Usage

1
2
3
4
5
6
7
8
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)

Arguments

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

Details

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.

Examples

1
2
3
4
5
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)

hadley/ggplot1 documentation built on Aug. 19, 2019, 2:42 p.m.