the correlation plot of sample rep1 and rep2

setwd('D:\\09_纳米水稻\\AA修图\\')
library(ggplot2)
library(ggsignif)
library(ggpubr)

data<-read.table('1_plot_dot_corBCD_CK.txt',header = 1)
data$Rep1=log2(data$rep1)
data$Rep2=log2(data$rep2)
table(data$sample)
options(scipen=3)
# data$sample<- factor(data$sample,
#                      levels= c('<=-1','-1~0',"0~1",">1"),ordered = TRUE)
# data$sample<- factor(data$sample,
#                      levels= c('Overlap','1~200bp',"201~2000bp",">2000bp"),ordered = TRUE)
> head(data)
  rep1 rep2 sample     Rep1      Rep2
1 1928 1323    BCD 10.91289 10.369597
2 5745 4417    BCD 12.48809 12.108851
3 5914 4276    BCD 12.52992 12.062046
4 8000 4556    BCD 12.96578 12.153552
5 6327 3264    BCD 12.62731 11.672425
6   49   42    BCD  5.61471  5.392317
ggplot(data, aes(x=Rep1, y=Rep2)) + 
  geom_point(size=1,alpha=0.8,color='#00CCFF')+
  stat_cor(method = 'pearson', aes(x=Rep1, y=Rep2), size = 5,
           label.y.npc = "top",color='black')+
  geom_smooth( aes(x=Rep1, y=Rep2),method="lm",se=FALSE,colour="red")+
  facet_wrap(~sample,nrow=1,scales = 'free')+
  theme_classic()+
  # xlim(0,200000)+
  # scale_fill_brewer(type="seq",palette="Set2")+
  ylab('Rep2')+xlab("Rep1")+
  # labs(title ='Correlation between gene FC and M value')+
  theme(strip.text.x = element_text( colour = 'black',size = 13),#size=8,angle=75
        strip.text.y = element_text( colour = 'black',size = 13),
        strip.background = element_rect(colour="white", fill="grey"),
        axis.title = element_text(#face = "bold",
          size = "18",color = "black"),
        axis.text.x = element_text(face = "bold",color = "black",#angle = 45,
                                   size = 12,  hjust = 0.5, vjust = 0.5),
        # axis.text.x = element_text(face = "bold",color = "black",angle = 45,
        #                            size = 12,  hjust = 1, vjust = 1),
        axis.text.y = element_text(face = "bold",size = 12,color = "black"),
        legend.text = element_text(size = 12,face = "bold"),
        legend.title = element_text(size = 12,
                                    face = "bold"),
        legend.position ='',
        # legend.key.size = 
        panel.grid.major.y = element_blank(),
        panel.grid.minor.y = element_blank(),
        panel.grid.major.x = element_blank(),
        panel.grid.minor.x = element_blank(),
        axis.line = element_line(size=1, colour = "black"),     #####################     坐标轴边框加粗(只能加粗左下轴)
        axis.ticks = element_line(size = 1),  
        # panel.border = element_rect(colour = "black", fill=NA, size=1),
        # axis.line = element_line(size=2, colour = "black"),
        plot.title = element_text(lineheight=.8, face="bold", hjust=0.5, size =16))


结果如下
在这里插入图片描述

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值