Вы можете использовать следующий код
library(tidyverse)
library(viridis)
df %>%
pivot_longer(cols = -id) %>%
ggplot(aes(x = name, y=value, fill = factor(id))) +
geom_col(position = position_dodge()) +
scale_fill_viridis(discrete = T, name = "Title") + theme_bw() +
scale_y_continuous(limits = c(0, max(df)+1),
expand = c(0, 0)) +
labs(x="", y="Proportion (%)") +
theme(text = element_text(family = "serif", color = "black", size = 15))+
theme(axis.text = element_text(family = "serif", color = "black", size = 12))
введите описание изображения здесь
Данные
df = structure(list(id = 1:5, `cycle1 (14 teachers)` = c(7.14, 14.3,
21.4, 14.3, 21.4), `cycle2 (16 teachers)` = c(18.8, 25, 25, 31.2,
18.8), `cycle3 (11 teachers)` = c(27.3, 27.3, 18.2, 36.4, 45.5
)), class = "data.frame", row.names = c(NA, -5L))