# SCI Figure Hub — Two-Factor Grouped Bar Chart (CC0-1.0) library(ggplot2) pal <- c("#E64B35", "#4DBBD5", "#00A087", "#3C5488") df <- expand.grid(cond = c("25 °C", "50 °C", "75 °C"), strain = c("WT", "M1", "M2", "M3")) df$val <- c(34, 52, 46, 48, 69, 78, 62, 86, 92, 55, 74, 81) df$err <- c(3.2, 4.1, 3.8, 3.5, 4.4, 4.2, 4.0, 3.9, 3.1, 3.7, 4.0, 3.9) dodge <- position_dodge(width = 0.76) p <- ggplot(df, aes(x = cond, y = val, fill = strain)) + geom_col(position = dodge, width = 0.68, colour = "#1E293B", linewidth = 0.25) + geom_errorbar(aes(ymin = val - err, ymax = val + err), position = dodge, width = 0.2, linewidth = 0.35) + scale_fill_manual(values = pal, name = NULL) + labs(x = NULL, y = "Conversion Yield (%)") + theme_classic(base_size = 8) + theme(legend.position = "top") ggsave("grouped_bar.pdf", p, width = 89, height = 64, units = "mm")