Open antgon opened 2 years ago
If a "broken" plot is combined with other plots using patchwork the axes are misaligned, e.g.:
patchwork
library(tidyverse) library(ggbreak) library(patchwork) df <- tibble( x = seq(0, 2*pi, 0.01), y1 = sin(x), y2 = sin(x * 2) + 100) plt1 <- ggplot(df, aes(x, y1)) + geom_line() plt2 <- plt1 + scale_x_break(c(1, 3), expand = F) plt3 <- ggplot(df, aes(x, y2)) + geom_line() (plt2 + plt1) / (plt1 + plt3) # Same with plot_layout, as in # plt2 + plt1 + plt1 + plt3 + plot_layout(nrow=2)
Incidentally, if I try to combine the same plots with cowplot instead of patchwork, the ggbreak::scale_x_break layer disappears:
cowplot
ggbreak::scale_x_break
library(cowplot) plot_grid(plt2, plt1, plt1, plt3, nrow=2, align="hv")
I would like to second the above issues
If a "broken" plot is combined with other plots using
patchwork
the axes are misaligned, e.g.:Incidentally, if I try to combine the same plots with
cowplot
instead ofpatchwork
, theggbreak::scale_x_break
layer disappears: