baptiste / gridExtra

Miscellaneous Functions for "Grid" Graphics
http://cran.r-project.org/web/packages/gridExtra/index.html
15 stars 4 forks source link

Maximum number of plots for grid.arrange() #36

Closed ma-lima closed 7 years ago

ma-lima commented 7 years ago

I want to show 100 plots, in a 10x10 arrangement.
I use a loop to generate the plots and name each one (G1, G2, GP3, G4 ... G100).

If I set up my loop for 20 iterations and use:

grid.arrange(G1,G2,G3,G4....G20,ncol=10)

I get what I expect: 20 plots in 2 rows with 10 columns in each row.

However, if I have more than 20 plots, I get the following message:

Error in arrangeGrob(...) : object 'G21' not found

Is there some internal limit to grid.arrange() that restricts it to 20 objects?
Is there a way to show more than 20 plots?

baptiste commented 7 years ago

there is no such restriction.

pl = replicate(50, ggplot(), FALSE)
grid.arrange(grobs = gl)

On 24 February 2017 at 04:11, ma-lima notifications@github.com wrote:

I want to show 100 plots, in a 10x10 arrangement. I use a loop to generate the plots and name each one (G1, G2, GP3, G4 ... G100).

If I set up my loop for 20 iterations and use:

grid.arrange(G1,G2,G3,G4....G20,ncol=10)

I get what I expect: 20 plots in 2 rows with 10 columns in each row.

However, if I have more than 20 plots, I get the following message:

Error in arrangeGrob(...) : object 'G21' not found

Is there some internal limit to grid.arrange() that restricts it to 20 objects? Is there a way to show more than 20 plots?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/baptiste/gridextra/issues/36, or mute the thread https://github.com/notifications/unsubscribe-auth/AABKGt9vkWmZ69tdhooO64huRPGOMAaEks5rfaGSgaJpZM4MKFV9 .