If I understand you correctly, space = "free_x"
does what you want in facet_grid
. As far as I know, facet_wrap
has never supported a space argument, but many facet_wrap
commands can be cast as facet_grid
commands.
library(ggplot2)
ggplot(mydf, aes(X, Y)) + geom_point()+
facet_grid (.~ groups, scales = "free_x", space = "free_x")
And if you want the same style of labelling on the x axes:
ggplot(mydf, aes(X, Y)) + geom_point()+
scale_x_continuous(breaks = seq(0,20,2)) +
facet_grid (.~ groups, scales = "free_x", space = "free_x")
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…