Description Usage Arguments Functions See Also Examples
Create a discrete or continuous scale using our colours
1 2 3 4 5 6 7 8 9 10 11 | our_scale_colour_d(palette = "default", reverse = F, ...)
our_scale_color_d(palette = "default", reverse = F, ...)
our_scale_colour_c(palette = "default", reverse = F, ...)
our_scale_color_c(palette = "default", reverse = F, ...)
our_scale_fill_d(palette = "default", reverse = F, ...)
our_scale_fill_c(palette = "default", reverse = F, ...)
|
palette |
Character name of palette in our_palettes_raw |
reverse |
Boolean indicating whether the palette should be reversed |
... |
Additional arguments passed to the scale constructor |
our_scale_colour_d
: discrete colour scale
our_scale_color_d
: alias for discrete colour scale
our_scale_colour_c
: continuous colour scale
our_scale_color_c
: alias for continuous colour scale
our_scale_fill_d
: discrete fill scale
our_scale_fill_c
: continuous fill scale
Other access our colours: our_colours
,
our_palettes
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | library(ggplot2)
# Discrete Colour scale
ggplot(mtcars) +
geom_point(aes(x = mpg,
y = wt,
color = as.character(carb))) +
our_scale_color_d('default')
# Continuous Colour Scale
ggplot(mtcars) +
geom_point(aes(x = mpg,
y = wt,
color = wt)) +
our_scale_color_c('default')
# Discrete Fill Scale
ggplot(mtcars) +
geom_col(aes(x = reorder(rownames(mtcars), mpg),
y = mpg,
fill = as.character(carb))) +
coord_flip() +
our_scale_fill_d('default') +
facet_wrap(~as.character(carb), scales='free_y')
# Continuous fill scale
ggplot(mtcars) +
geom_col(aes(x = reorder(rownames(mtcars), mpg),
y = mpg,
fill = mpg)) +
coord_flip() +
our_scale_fill_c('default')
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.