0

I have a plot with 4 subplots that I merge using facet_grid()

the four plots are next to each other and since the labels on the x-axes are the same for all 4 plots it is only displayed once in the middle.

Is it possible to have the x-axis label displayed for all four subplots?

upabove
  • 1,057
  • 3
  • 18
  • 29
  • you can use `facet_wrap` with `scales = "free"` – baptiste Feb 24 '14 at 10:43
  • this will display the y-axis for each plot, but not the x-axis labels – upabove Feb 24 '14 at 10:49
  • as an example: http://docs.ggplot2.org/0.9.3.1/facet_grid-12.png I want "carat" to be displayed for each plot – upabove Feb 24 '14 at 10:56
  • Please make your question [reproducible](http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) - the behaviour (I think) you're describing doesn't sound like the default. – alexwhan Feb 24 '14 at 11:03
  • 1
    it [can show you the x-axes](http://docs.ggplot2.org/0.9.3.1/facet_wrap-20.png), but you won't get multiple axis titles. You'll have to do some post-processing for that, e.g. with gtable. – baptiste Feb 24 '14 at 11:18
  • Another solution might be to plot the four subplots seperately and combine them with `grid.arrange` from the `gridExtra` package. For some inspiration, see [this answer](http://stackoverflow.com/questions/20524630/modify-x-axis-labels-in-each-facet/20528655#20528655) – Jaap Feb 24 '14 at 19:02

0 Answers0