グループ別箱ひげ図

グループ別箱ひげ図テンプレート。複数群×複数条件の比較に使用。

箱ひげ図グループ比較
グループ別箱ひげ図

R Code (ggplot2)

library(ggplot2)

# ---- Grouped Box Plot ----
# あなたのデータを入力してください
df <- data.frame(
  x = c(),
  y = c()
)

ggplot(df, aes(x = x, y = y)) +
  geom_point(size = 2) +
  geom_line() +
  scale_x_continuous(name = "Category", limits = c(0, 6)) +
  scale_y_continuous(name = "Value", limits = c(0, 100)) +
  labs(title = "Grouped Box Plot") +
  theme_bw(base_size = 14) +
  theme(plot.title = element_text(face = "bold", hjust = 0.5))