library(data.table)
library(forcats)
library(ggplot2)
md <- CJ(week = fct(c("Week 1", "Week 2", "Week 3")),
city = fct(c("卡達", "以色列", "黎巴嫩")),
role = fct(c("龐德", "伊森", "包恩")))
md$mission <- c(2, 2, 2, 1, 5, 2, 3, 1, 1, 1, 2, 2, 5, 4, 1, 5, 3, 0,
2, 2, 0, 0, 0, 8, 5, 0, 0)
md |>
ggplot(aes(x = city, y = mission)) +
geom_col(aes(fill = role)) +
facet_wrap(~ week, strip.position = "bottom") +
theme_minimal() +
theme(text = element_text(size = 12, family = "Microsoft JhengHei"))
Created on 2023-11-07 with reprex v2.0.2