如何更改ggboxplot中箱线图的顺序?
How to change the order of boxplots in ggboxplot?
下面是我目前拥有的创建下图的代码。相反,我试图制作一个图表,其中蓝色箱线图(双关语)在 x 轴的 'pun' 标题下彼此相邻,在黄色箱线图 'mv'.[=12= 旁边]
ggboxplot(
d, x = "Condition.Name", y = c("pun", "mv"),
merge = TRUE, palette = "jco",
title = NULL,
xlab = '',
ylab = ''
)
使用 mtcars
因为您没有提供数据。您需要 combine
而不是 merge
和 ggpubr::ggboxplot
library(ggpubr)
#> Loading required package: ggplot2
ggboxplot(
mtcars,
x = "am",
y = c("disp", "hp"),
combine = TRUE,
color = c("#0073C2FF", "#EFC000FF", "#0073C2FF", "#EFC000FF"),
title = NULL,
ylab = ''
)
下面是我目前拥有的创建下图的代码。相反,我试图制作一个图表,其中蓝色箱线图(双关语)在 x 轴的 'pun' 标题下彼此相邻,在黄色箱线图 'mv'.[=12= 旁边]
ggboxplot(
d, x = "Condition.Name", y = c("pun", "mv"),
merge = TRUE, palette = "jco",
title = NULL,
xlab = '',
ylab = ''
)
使用 mtcars
因为您没有提供数据。您需要 combine
而不是 merge
和 ggpubr::ggboxplot
library(ggpubr)
#> Loading required package: ggplot2
ggboxplot(
mtcars,
x = "am",
y = c("disp", "hp"),
combine = TRUE,
color = c("#0073C2FF", "#EFC000FF", "#0073C2FF", "#EFC000FF"),
title = NULL,
ylab = ''
)