library(ggplot2)
fills <- tntp_palette("top2_5")
diamonds |>
dplyr::summarize(m = mean(price), .by = cut) |>
ggplot(aes(cut, m, fill = cut)) +
geom_col() +
geom_text(aes(label = scales::dollar(m), color = cut), vjust = 1.5) +
scale_fill_manual(values = fills, guide = "none") +
scale_color_manual(values = choose_text_color(fills), guide = "none") +
tntp_style(family = "sans")
Run the code above in your browser using DataLab