Allow facets to span multiple pages #86

Closed
hadley opened this Issue Mar 21, 2010 · 14 comments

Projects

None yet
@hadley
Member
hadley commented Mar 21, 2010

Proposed syntax: page.layout = c(rows, cols)

@mikedewar

This would be awesome.

@bullfight

I would definitely appreciate this feature as well.

@hadley
Member
hadley commented Jan 10, 2011

Probably should be different for facet_wrap and facet_grid - suggestion from David Cooper:

+ facet_grid(cyl ~ drv, by = manufacturer)
+ facet_grid(manufacturer ~ cyl ~ drv)
@b-lev
b-lev commented Oct 9, 2012

This would be very awesome. Seems like an obvious, missing feature of ggplot.

@bakerwm
bakerwm commented Jan 9, 2014

I'd like to use ggplot to draw this figure, 2x2 per page into multiple pages.

xyplot(price ~ carat | clarity, diamonds, layout = c(2, 2))

@landisrm
landisrm commented Feb 4, 2014

Yes please! I would love to have a layout option for facet_wrap and facet_grid. It seems less obvious how to do this for facet_grid, but for sure, I would use facet_wrap(layout) all the time. It is one of the main (only?) things that keeps me from switching from lattice.

@hadley
Member
hadley commented Feb 24, 2014

This sounds like a great feature, but unfortunately we don't currently have the development bandwidth to support it. If you'd like to submit a pull request that implements this feature, please follow the instructions in the development vignette.

@hadley hadley closed this Feb 24, 2014
@guiastrennec

I know this issue has been closed but for people like me who work with hundreds of facets, I have uploaded a ggplot2 wrapper on github that allows to use facet_wrap() on multiple page. Check the facet_multiple() function here. Hope it helps !

@pmBarlev

facet_multiple() works well, thanks!

@thomasp85
Collaborator
thomasp85 commented Sep 22, 2016 edited

ggforce will also have facet_wrap_paginate() and facet_grid_paginate() once the next version of ggplot2 is released...

@daattali
Contributor

@thomasp85 would be useful if you provide a link to ggforce in your comment (of course I was able to find it on google). I see the paginate features are in the facets branch, will it not work with the current CRAN version of ggplot2?

@thomasp85
Collaborator

It was written from a phone - I've updated the comment with link.

The facet branch requires the GitHub version to work, but the next ggplot2 release is imminent

@billdenney

While the issue is closed, there are two good solutions. I wonder if either @thomasp85 or @guiastrennec would perhaps suggest a pull request to ggplot that would enable your feature to provide a "page" argument to both facet_wrap and facet_grid?

@guiastrennec

Thank you for your interest @billdenney. Unfortunately ggplus::facet_multiple() is no longer compatible with ggplot in v2.2.0 unlike ggforce.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment