使用ggpubr绘制反映指标动态变化的箱图
library(ggplot2)
library(ggpubr)
library(patchwork)
# ALT
bp1 <- ggdotplot(LiverRoi, "Time point", "AST",
add = "boxplot",
color = "Time point", fill = "Time point",
xlab = FALSE,
ylab = 'AST (IU/L)',
palette = c("#00AFBB", "#E7B800", "#FC4E07","#00BA38","#F8766D","#3300FF"))
bp1 <- bp1 + scale_x_discrete(
breaks = c("1", "2", "3","4","5","6"),
labels = c("Baseline", "After T1", "After T2", "Before Surgery","POD5","POD10")
) +
scale_y_continuous(breaks=seq(0, 600, 100)) +
geom_hline(aes(yintercept = 300), colour = "black",linetype = 'dashed') +
theme(legend.position="none")
bp1
Figure1.jpeg
参考资料:
公众号:珠江肿瘤 R语言|ggpubr 包绘图系列(2)
网友评论