R 并排箱形图在 x-axis 处添加标题
R side by side box plot add title at x-axis
我制作了一个并排的箱形图,
sidebox <- boxplot(Decreased$Group.1, xlim=c(0,6), ylim=c(0,10), at=1)
sidebox <- boxplot(Unchanged$Group.1, add=TRUE, at=3)
sidebox <- boxplot(Increased$Group.1, add=TRUE, at=5)
结果出来了
我的问题是如何在 x-axis 处为每个箱形图添加标题
喜欢 "Decreased", "Unchanged","Increased"
最简单的方法是一次制作箱线图并使用 names
参数:
set.seed(10)
dat <- list(rlnorm(100), rlnorm(100), rlnorm(100))
boxplot(dat, names = c("Group 1", "Group 2", "Group 2"))
我制作了一个并排的箱形图,
sidebox <- boxplot(Decreased$Group.1, xlim=c(0,6), ylim=c(0,10), at=1)
sidebox <- boxplot(Unchanged$Group.1, add=TRUE, at=3)
sidebox <- boxplot(Increased$Group.1, add=TRUE, at=5)
结果出来了
我的问题是如何在 x-axis 处为每个箱形图添加标题
喜欢 "Decreased", "Unchanged","Increased"
最简单的方法是一次制作箱线图并使用 names
参数:
set.seed(10)
dat <- list(rlnorm(100), rlnorm(100), rlnorm(100))
boxplot(dat, names = c("Group 1", "Group 2", "Group 2"))