I have a some trouble about removing the space in between x axis values.
I want to remove the gap between two values in each facet_wrap
I checked this
If you turn direc
into a factor with levels c('B', 'A')
(to arrange facets with B
on the left),
df$direc <- factor(direc, levels = c("B", "A"))
just replacing facet_wrap
with a facet_grid
does the trick.
ggplot(data = df, aes(x = x, y = yy, colour = direc)) +
geom_point(size=5)+
geom_line(size=1.3)+
scale_y_log10(limits = c(1e-7,1),breaks = c(3e-7,1e-3,1e-1,1))+
facet_grid(add ~ direc, scales = 'free')
Well, a trick; hopefully it's what you want:
The colour
argument is also technically unnecessary with this arrangement, though it doesn't cause any issues. I took out scale_x_continuous
, as well, because it gets overridden by scales = 'free'
.