library(ggplot2)
library(ggforma)

trips <- data.frame(mode = c("Walk", "Cycle", "Rail"), n = c(24, 36, 40))
colours <- setNames(forma_palette(5)[2:4], trips$mode)
ggpie(trips, "mode", "n", label = "percent", palette = colours, .legend = TRUE) +
  labs(title = "Trips by mode", caption = "Illustrative counts")
