R:快速绘制SCI直方图

library("ggplot2")
library(ggprism) #可以完善ggplot2的图使之达到发表级别

miRNA_RT <- read.csv("miRNAfamily.csv",header = T)
#按照指定顺序绘制直方图
ggplot(miRNA_RT,aes(x=reorder(miRNA_family,-Count), y=Count) + 
    geom_bar(stat="identity", fill="#f68060", alpha=.6, width=.4)+
    xlab("miRNA family")+
    scale_y_continuous(expand = c(0,0))+ #纵坐标从0开始
    theme_prism(base_size=10) + #出版字体
     #coord_flip() + #转换xy轴
    #xlab("") + #x轴标题
    theme(axis.text.x=element_text(angle = 45,hjust = 0.5,vjust = 0.5))
#修改reorder里的Count为-,即倒序排列
ggplot(miRNA_RT,aes(x=reorder(miRNA_family,-Count), y=Count) + 
    geom_bar(stat="identity", fill="#f68060", alpha=.6, width=.4)+
    xlab("miRNA family")+
    scale_y_continuous(expand = c(0,0))+ #纵坐标从0开始
    theme_prism(base_size=10) + #出版字体
    theme(axis.text.x=element_text(angle = 45,hjust = 0.5,vjust = 0.5))


miRNA_RT数据格式如下: miRNA_family Count MIR162_1 1 MIR393 3 MIR160 4 MIR394 2 image.png image.png

回到页面顶部