ChrisLou-bioinfo / gg.gap

Easy to define segments in y-axis for 'ggplot2'.
GNU General Public License v3.0
27 stars 5 forks source link

Problem using gg.gap with facets #1

Open almeidasilvaf opened 4 years ago

almeidasilvaf commented 4 years ago

When I use facets and gg.gap, it splits the plot in two (each plot with the facet title) instead of just adding a gap. The same issue can be noticed with the example code provided by the developer. I don't think it was intended, because no one would add such a strange plot.

Code:

library(ggplot2)
library(gg.gap)
p <- ggplot(mtcars,aes(mpg,hp)) + geom_point()
p1 <- p + facet_wrap(~cyl, scales="free")
gg.gap(plot = p1,ylim = c(60,200), segments = c(100,120))

Figure:

gg gap facet

The facet titles ("4", "6" and "8") should be only one.