man/examples/scale_fill_dft.R

## Simple bar chart using default palette

library(ggplot2)

df <- mpg[mpg$class %in% c("subcompact", "compact", "midsize", "suv"),]

ggplot(df, aes(manufacturer)) +
  geom_bar(aes(fill=class), width = 0.5) +
  theme(axis.text.x = element_text(angle=65, vjust=0.6)) +
  scale_fill_dft()
department-for-transport/dftplotr documentation built on April 3, 2024, 3:55 p.m.