利用boxplot(exprSet,col= cols , main ="expression", las =2)得到上图结果,通过加入outline= F,可以纠正错误。
P_density_GeneID = ggplot(datExp,aes(x=Exp))+
geom_density(aes(fill=as.character(datExp$Sample),color=as.character(datExp$Sample)),alpha = 0,size=1,linetype="solid")+
labs(x="expression")+
theme(plot.title = element_text(size = 25,face = "bold", vjust = 0.5, hjust = 0.5),
legend.title = element_blank(),
legend.text = element_text(size = 15, face = "bold"),
legend.position = 'right',
###坐标轴标签设置
axis.line=element_line(size = 1,color="black"),
axis.ticks.x=element_blank(),
axis.text.x=element_text(size = 15,face = "bold", vjust = 0.5, hjust = 0.5),
axis.text.y=element_text(size = 15,face = "bold", vjust = 0.5, hjust = 0.5),
axis.title.x = element_text(size = 20,face = "bold", vjust = 0.5, hjust = 0.5),
axis.title.y = element_text(size = 20,face = "bold", vjust = 0.5, hjust = 0.5),
##背景设置
panel.background = element_rect(fill = "transparent",colour = NA),
panel.grid.minor = element_blank(),
panel.grid.major = element_blank(),
plot.background = element_rect(fill = "transparent",colour = NA))