library(gcookbook)
library(ggplot2)
library(reshape2)
data <- read.csv("File_tpm.csv",row.names =1)
data1 <- data[rowSums(data) > 10,]
data1 <- data1[rowSums(data1) < 500,]
data_melt <- melt(data1)
ggplot(data_melt, aes(x = variable , y = value , fill = variable)) +
geom_violin(alpha = 0.5,aes(linetype=NA)) +
geom_jitter(shape=21,aes(fill=variable),position = position_jitter(width = 0.2))+
xlab("sample")+ylab("tpm")+
theme_bw()+
theme(legend.position = "none")
![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/905ca5f6b4cf05c612d79421d3ab1d55.png)
ggplot(data_melt, aes(x = variable , y = value , fill = variable)) +
geom_violin(alpha = 0.5)+
stat_summary(fun.y=median, geom="point", fill="white",shape=21,size=2.5)
![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/d54436bd019486d0440e0771c5845bc2.png)