Description
Hello there,
I was comparing the output of facet_wrap()
with an extension thereof I'm trying to make, and I found that there is this one case when the placement of the x-axis is unexpected. In the first row of facets, I would have expected that in the 2nd and 3rd columns of panels, there would be no x-axes, because the bottom row already has these axes.
library(ggplot2)
ggplot(mpg, aes(displ, hwy)) +
geom_point() +
facet_wrap(vars(class),
dir = "v", as.table = FALSE)
Created on 2021-07-10 by the reprex package (v1.0.0)
I think I might have narrowed the scope of this glitch down to the lines below, but found it hard to figure out what exactly would need to change. I suspect that in the example above, first_col
evaluates to 0, which might violate some assumptions later. Any other combination of the dir
and as.table
parameters don't have empty panels in the first column, as far as I know.
Lines 315 to 341 in acaa98e
I don't think this crucial to fix, as this combination of parameters might not be widely used, but I thought the ggplot2 developers might like to know about this.
Thanks for reading!