Facet_wrap无法与geom_bar一起使用,但与geom_point一起使用

时间:2018-07-17 13:29:25

标签: r geom-bar facet-wrap

我的facet_wrap图可以很好地与点配合使用,但是当我想将这些点更改为条形时,则无法使用。 scale_y_reverse。

ggplot(data=depth, aes(x=value, y=Depth)) + facet_wrap(~variable, ncol=7) + labs(x="Macroalgae genes (TPM)", y="Depth (m)") +scale_y_reverse(expand = c(0.03, 0.03), labels=layers) + geom_point(aes(color = variable), shape=1) + theme_bw() + theme(plot.margin=unit(x=c(0.3,0.8,0.3,0.3), units="cm"), 
                 axis.text=element_text(size=13, family="Times New Roman", color="black"), 
                 axis.title = element_text(size = 20, family="Times New Roman"), strip.background = element_blank(), 
                 strip.text = element_text(face="bold", size=13, lineheight=5.0, family="Times New Roman"), 
                 legend.position="none", panel.grid.major = element_blank(), panel.border = element_blank(), 
                 panel.spacing.y=unit(0.3, "lines"), panel.spacing.x=unit(0.15, "lines"),panel.grid.minor = element_blank(), 
                 panel.background = element_blank(), plot.background = element_rect(fill = "transparent",colour = NA), 
                 axis.line = element_line(colour = "black"))

如何将点更改为条形?

Plot is here

谢谢!

0 个答案:

没有答案