V1 横坐标,V2数量
画图前加这个:
$V1=factor(data$V1,levels = rev(data$V1))
即
data<-read.table("top20.txt",header = F,sep = "\t")
data$V1=factor(data$V1,levels = rev(data$V1))
ggplot(data = data)+geom_bar(aes(data$V1,data$V2,fill=data$V1),stat="identity")+labs(x="")+ylab("Gene Number")+theme_bw()+theme(axis.text.x = element_blank(),legend.title = element_blank())
网友评论