Grouped box plot using tidyplots

Would it be acceptable to copy the colors from tidyplot into ggplot?

#colors from https://jbengler.github.io/tidyplots/articles/Color-schemes.html
c("#0072B2","#56B4E9","#009E73","#F5C710","#E69F00","#D55E00")

#Selected colors
scenario_colors <- c("#0072B2","#56B4E9","#F5C710","#D55E00")

library(ggplot2)
ggplot(combined_df, aes(x = Metric, y = Value, color = scenario)) +
  geom_boxplot(outlier.shape = NA, fill = "gray90", color = "gray50", width = 0.6) +
  geom_jitter(width = 0.2, size = 3, alpha = 0.7) +
  facet_wrap(~ Sector, nrow = 1) +
  scale_color_manual(values = scenario_colors) +
  geom_hline(yintercept = 0, linetype = "dashed", color = "black", linewidth = 0.3) +
  labs(
    title = NULL,
    subtitle = NULL,
    y = "Resilience Metric Value",
    x = NULL,
    color = "Resilience Scenario"
  ) +
  theme_minimal(base_size = 14) +
  theme(
    panel.grid = element_blank(),  # remove grid lines
    panel.border = element_rect(color = "black", fill = NA, linewidth = 0.8),  # add black border
    axis.line = element_line(color = "black", linewidth = 0.5),  # add axis lines
    axis.ticks = element_line(color = "black")  # optional: make tick marks black too
  )
1 Like