DotPlot中画图指定横坐标
画出来的图的纵坐标是按照字母顺序排序的,也可以设置想要的顺序。
·
p=DotPlot(norecur,features = c("gene1","gene2","gene3"))
data.usage <-p[["data"]]
data.anno <- data.frame(features.plot=unique(p[["data"]][["features.plot"]]),label=unique(p[["data"]][["features.plot"]]))
df.plot <- plyr::join(data.usage,data.anno)
df.plot$id <- factor(df.plot$id,levels = sort(levels(df.plot$id),decreasing = T) )
ggplot(df.plot,aes(x=features.plot,y = id,size = pct.exp, color = avg.exp.scaled))+geom_point()+theme(axis.text.x = element_text(angle = 45,hjust = 1)) +labs(title = "pic1")
画出来的图的纵坐标是按照字母顺序排序的,也可以设置想要的顺序
更多推荐
所有评论(0)