-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Closed
Description
I found a problem with using ggplot2 v4.0.0 together with patchwork. The code below results in the following error:
Error in `<current-expression>` : node stack overflow
Error during wrapup: node stack overflow
Error: no more error handlers available (recursive errors?); invoking 'abort' restart
With ggplot2 < 4.0.0, this would produce a plot that combined the line plot and a density plot to the right hand side of it.
Here is the code to reproduce the bug:
library(ggplot2)
library(patchwork)
df <- data.frame(
sim = rep(1:10, 2),
value = rnorm(20),
name = rep(c("A", "B"), each = 10)
)
facet_spec <- facet_grid(name ~ ., scales = "free", switch = "y")
p1 <- ggplot(df, aes(sim, value)) +
geom_line() +
facet_spec
p2 <- ggplot(df, aes(y = value)) +
geom_density() +
facet_spec
wrap_plots(p1, p2, ncol = 2)
Metadata
Metadata
Assignees
Labels
No labels