Skip to contents

Set afcharts theme, colour palette and geom aesthetic defaults for ggplot2 charts.

Usage

use_afcharts(default_colour = af_colour_values["dark-blue"], ...)

Arguments

default_colour

Default colour/fill for geoms. Default value is 'blue' from af_colour_values.

...

Arguments passed to theme_af().

Examples

library(ggplot2)

d <- subset(mpg, manufacturer == "ford")

ggplot(d, aes(x = model)) + geom_bar()

ggplot(d, aes(x = model, fill = class)) + geom_bar()


use_afcharts()
#>  Default ggplot2 theme set to `theme_af`.
#>  Default colours set.
#>  Default geom aesthetics set.

ggplot(d, aes(x = model)) + geom_bar()

ggplot(d, aes(x = model, fill = class, colour = class)) + geom_bar()
#> Warning: The `scale_name` argument of `discrete_scale()` is deprecated as of ggplot2
#> 3.5.0.