点图
library(tidyverse)
library(ggsci)
df <- read_csv("data.csv")
p <- read_tsv("group.xls") %>% left_join(.,df,by="sample") %>% 
  unite(.,col="group",group1:group2,sep="_",remove = T,na.rm = F) %>% 
  pivot_longer(Shannon.Wiener:pielou) %>% select(-sample)
p %>% ggplot(aes(x = group, y =value,fill =group,group=1)) +
  stat_summary(fun.data="mean_cl_normal",geom="errorbar",width=0.2) +
  stat_summary(fun = "mean",geom = "point",size=5,pch=21)+
  stat_summary(fun = "mean", geom = "line",size=0.5)+
  annotate("rect",xmin="Control_A",xmax="Control_B",ymin=-Inf,ymax=Inf,alpha=0.3,fill="grey")+
  facet_wrap(.~name,scales = "free",labeller = label_wrap_gen(),nrow = 2)+
  scale_fill_npg()+
  theme_test()+
  theme(panel.spacing.x = unit(0.2,"cm"),
        panel.spacing.y = unit(0.1, "cm"),
        axis.title = element_blank(),
        strip.text.x = element_text(size=9,color="black"),
        axis.text = element_text(color="black"),
        axis.text.x=element_blank(),
        axis.ticks.x=element_blank(),
        legend.text = element_text(color="black",size=9),
        legend.title=element_blank(),
        legend.spacing.x=unit(0.1,'cm'),
        legend.key=element_blank(),
        legend.key.width=unit(0.4,'cm'),
        legend.key.height=unit(0.4,'cm'),
        legend.position = "top",
        plot.margin=unit(c(0.3,0.3,0.3,0.3),units=,"cm"))+
  guides(fill = guide_legend(direction = "horizontal"))+
  guides(fill=guide_legend(nrow=1, byrow=TRUE))

暂无评论

发送评论 编辑评论


				
|´・ω・)ノ
ヾ(≧∇≦*)ゝ
(☆ω☆)
(╯‵□′)╯︵┴─┴
 ̄﹃ ̄
(/ω\)
∠( ᐛ 」∠)_
(๑•̀ㅁ•́ฅ)
→_→
୧(๑•̀⌄•́๑)૭
٩(ˊᗜˋ*)و
(ノ°ο°)ノ
(´இ皿இ`)
⌇●﹏●⌇
(ฅ´ω`ฅ)
(╯°A°)╯︵○○○
φ( ̄∇ ̄o)
ヾ(´・ ・`。)ノ"
( ง ᵒ̌皿ᵒ̌)ง⁼³₌₃
(ó﹏ò。)
Σ(っ °Д °;)っ
( ,,´・ω・)ノ"(´っω・`。)
╮(╯▽╰)╭
o(*////▽////*)q
>﹏<
( ๑´•ω•) "(ㆆᴗㆆ)
😂
😀
😅
😊
🙂
🙃
😌
😍
😘
😜
😝
😏
😒
🙄
😳
😡
😔
😫
😱
😭
💩
👻
🙌
🖕
👍
👫
👬
👭
🌚
🌝
🙈
💊
😶
🙏
🍦
🍉
😣
Source: github.com/k4yt3x/flowerhd
颜文字
Emoji
小恐龙
花!
上一篇
下一篇