overflowname
overflowname

Reputation: 2193

x-axis labels in facet_wrap for ggplot2

Possible Duplicate:
add “floating” axis labels in facet_wrap plot

I am creating a panel of time series charts in RExcel using ggplot2. I have seen in many examples that the default when using ggplot2 seems to be to put the x-axis labels at the bottom of each column, even if the column does not reach all the way to the bottom (eg a 3 by 3 sapce filled with 7 plots, so two blank spaces on the lower left but with x-axis labels repeating three times across the bottom, one for each column).

My code, however, produces x-axis labels only on the bottom of the columns that reach all the way to the bottom. I have been playing around with this for a while and did not see anyone else with the same problem - thanks for helping me out!

(I added a minimal reproducible example, which is where the image comes from as well http://docs.ggplot2.org/current/facet_wrap.html)

library(ggplot2)
library(hexbin)
d <- ggplot(diamonds, aes(carat, price, fill = ..density..)) +
  xlim(0, 2) + stat_binhex(na.rm = TRUE) + theme(aspect.ratio = 1)
d + facet_wrap(~ color)

enter image description here

Thank you! Please let me know if my question was not clear or if I can provide any additional info that may be of use.

Upvotes: 4

Views: 511

Answers (0)

Related Questions