Force X axis on both graphs in a facet grid when X values are the same

前端 未结 1 1332
我寻月下人不归
我寻月下人不归 2021-01-11 14:22

I have data with about 30 categories for the X axis in two groups for faceting. I will show this with some random data:

dataf <- data.frame(x=c(1:30), A=r         


        
相关标签:
1条回答
  • 2021-01-11 15:05

    Try using facet_wrap instead:

    ggplot(datam, aes(factor(x), value)) + 
        geom_bar(stat="identity") + 
        facet_wrap(~variable,nrow = 2,scales = "free")
    

    enter image description here

    0 讨论(0)
提交回复
热议问题