-
Notifications
You must be signed in to change notification settings - Fork 162
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error in valid.viewport: 'x', 'y', 'width', and 'height' must all be units of length 1 #277
Comments
The issue is caused by the first plot: It contains the following line when constructing that reproducibly causes the error: Here, the |
Here a MWE without any other data: library(tidyverse) g1 | ggplot() + theme_void() |
I'm not working on patchwork at the moment but PRs are welcome |
Hi, will you continue working on it or development and bugfixes are stalled forever? Just for me to know what to expect in the future and whether or not to integrate your package in my packages, recommending it to others etc. Thanks |
I will continue to work on it, but I tackle packages in cycles to avoid context-shifts all the time |
Hi, @thomasp85 Do you have maybe some plans about this issue? Is this something very complex to address? Is there any chance for this very issue to fix? |
have you tried egg ggarrange ? library(ggplot2)
library(egg)
#> Loading required package: gridExtra
data = tibble::tibble(a = factor(rep("c", 10),levels = c("c", "x")), b = as.factor(c(rep("c", 5), rep("c", 5))), data = rnorm(10))
g1 = ggplot(data, aes(x = data)) + geom_density() + facet_wrap(~a + b)
egg::ggarrange(g1 , ggplot() + theme_void(),ncol=2) Created on 2023-06-08 with reprex v2.0.2 |
Hi, with R 3.6 I get the following error when plotting two ggplots for patchwork 1.1.1:
`g1 | g2
Error in valid.viewport(x, y, width, height, just, gp, clip, xscale, yscale, :
'x', 'y', 'width', and 'height' must all be units of length 1`
Plotting them individually works just fine, just the combination via patchwork does not. For other plots, patchwork works.
I saved both plots in R in a variable and then exported as rds for reproducibility. I zipped them and put them here (uploading here didnt work due to their size):
https://www.dropbox.com/s/7xwcddmdcf118h3/patchwork_bug.zip?dl=0
The text was updated successfully, but these errors were encountered: