Skip to contents

These scale functions help alter ggplot2 colour and fill to colours in the ucsc branding scheme. See the colour palettes in ucsc_pal for variations you can choode from.

Usage

scale_colour_ucsc(palette = "bluewhite", discrete = TRUE, reverse = FALSE, ...)

scale_color_ucsc(palette = "bluewhite", discrete = TRUE, reverse = FALSE, ...)

scale_fill_ucsc(palette = "redblack", discrete = TRUE, reverse = FALSE, ...)

Arguments

palette

Character name of palette in ucsc_pal.

discrete

Logical indicating whether colour aesthetic is discrete or not

reverse

Logical indicating whether the palette should be reversed

...

Additional arguments passed to discrete_scale or scale_color_gradientn, used respectively when discrete is TRUE or FALSE

Examples

library(ggplot2)

ggplot(mtcars, aes(mpg, disp, colour = cyl)) +
  geom_point(size = 5) +
  scale_colour_ucsc(discrete = FALSE)


ggplot(mtcars, aes(mpg, disp, colour = cyl)) +
  geom_point(size = 5) +
  scale_colour_ucsc(discrete = FALSE, reverse = TRUE)


ggplot(mtcars, aes(mpg, disp, colour = cyl)) +
  geom_point(size = 5) +
  scale_colour_ucsc(discrete = FALSE)


ggplot(mtcars, aes(mpg, disp, colour = factor(cyl))) +
  geom_point(size = 5) +
  scale_colour_ucsc()