Skip to content
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

save patchwork list in pdf doesn´t work #304

Closed
ghost opened this issue Jul 12, 2022 · 1 comment
Closed

save patchwork list in pdf doesn´t work #304

ghost opened this issue Jul 12, 2022 · 1 comment

Comments

@ghost
Copy link

ghost commented Jul 12, 2022

Hi

I've created a list of 13 elements like this:

Captura de Pantalla 2022-07-12 a la(s) 3 52 46 p  m

Each element in my list is a "composed" plot (as the image) created with 2 ggplots, (right and left). I've merged both plots using patchwork.

Now, I would like to save this list of 13 patchwork-ggplots elements in one pdf using each "composed" plot in a page. However I can't do it. I used ggsave to save the whole list as an element but i received the next error: Saving 12.9 x 11.2 in image Error in UseMethod("grid.draw") : no applicable method for 'grid.draw' applied to an object of class "list"

When I check the structure (str) of my list I found this:

List of 13 (I'm showing just the first element)
b_cell_naive :A patchwork composed of 2 patches
- Autotagging is turned off
- Guides are collected
Layout:
2 patch areas, spanning 2 columns and 1 rows
t l b r
1: 1 1 1 1
2: 1 2 1 2

Someone could help me to save my plot list please. In attach the list file in Rdata format
Thank you so much for your help

tempx.Rdata.zip

@thomasp85
Copy link
Owner

ggsave() is not supposed to work with a list of plots. The best way is to open a pdf device (using pdf()) and loop over your plots, printing them one by one...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant