如何更改ggplot上重要性栏的类型?

时间:2019-05-20 20:34:39

标签: r ggplot2 significance ggpubr

我有一个ggplot,显示带有括号的重要性,但我的老板希望它们上下都有刻度线(请参见下图)。同样,我的老板希望“ ns”成为大写字母。是否有一种无需手动控制它的好方法?我总共要制作10个地块。

p <- ggplot(LessCountS, aes(x=Type, y=DC)) + 
  geom_dotplot(aes(fill= Type), binwidth = 4.5,
               binaxis = "y", 
               stackdir = "center",
               color = "black" 
  ) +
  theme_gray ()+
  labs(x="", y = "Cell Count (cells/uL")+
  ggtitle("Dendritic cells") +
  scale_x_discrete(labels=c("HC" = "Controls", "IN" = "Inpatients",
                            "OUT" = "Outpatients")) +
  theme(plot.title = element_text(hjust = 0.5, size = 14), legend.text=element_text(size=12), 
        legend.position = "none", text = element_text(family = "Calibri"), axis.text = element_text(size=14),
        axis.title = element_text(size = 14)) +
  #scale_fill_brewer(palette="Purples") +
  scale_fill_manual(values=c("#CCCCCC", "#990066", "#3366CC")) +
  stat_summary(fun.y = median, fun.ymin = median, fun.ymax = median,
               geom = "crossbar", width = 0.35) +
  stat_compare_means(comparisons = my_comparisons, label.y = , label = "p.signif", size = 5)
p

enter image description here

我希望剧情看起来像这样: enter image description here

请注意重要性表示法上的差异,我希望使树突状图看起来像中性粒细胞图。

预先感谢, S

0 个答案:

没有答案