library(tidyverse)
# Example data
plot_data <- mpg |>
mutate(cyl = factor(cyl)) |>
group_by(cyl) |>
summarize(n = n())
# ew that yellow is gross
ggplot(plot_data, aes(x = cyl, y = n, fill = cyl)) +
geom_col() +
scale_fill_viridis_d(option = "magma")# Trim the range of the viridis panel
ggplot(plot_data, aes(x = cyl, y = n, fill = cyl)) +
geom_col() +
scale_fill_viridis_d(option = "magma", end = 0.8)Created on 2024-12-03 with reprex v2.1.1

