facet_grid
will allow you to split
a facetted plot over multiple pages. You define a number of rows and columns
per page as well as the page number to plot, and the function will
automatically only plot the correct panels. Usually this will be put in a
loop to render all pages one by one.
facet_grid_paginate(facets, margins = FALSE, scales = "fixed", space = "fixed", shrink = TRUE, labeller = "label_value", as.table = TRUE, switch = NULL, drop = TRUE, ncol = NULL, nrow = NULL, page = 1, byrow = TRUE)
FALSE
, no additional facets are included (the
default). If TRUE
, margins are included for all faceting
variables. If specified as a character vector, it is the names of
variables for which margins are to be created."fixed"
), or do they vary across rows ("free_x"
),
columns ("free_y"
), or both rows and columns ("free"
)"fixed"
, the default, all panels have the same size.
If "free_y"
their height will be proportional to the length of the
y scale; if "free_x"
their width will be proportional to the
length of the x scale; or if "free"
both height and width will
vary. This setting has no effect unless the appropriate scales also vary.TRUE
, will shrink scales to fit output of
statistics, not raw data. If FALSE
, will be range of raw data
before statistical summary.~cyl + am
. Each output
column gets displayed as one separate line in the strip
label. This function should inherit from the "labeller" S3 class
for compatibility with labeller()
. See
label_value
for more details and pointers to other
options.TRUE
, the default, the facets are laid out like
a table with highest values at the bottom-right. If FALSE
, the
facets are laid out like a plot with the highest value at the top-right."x"
, the top labels will be
displayed to the bottom. If "y"
, the right-hand side
labels will be displayed to the left. Can also be set to
"both"
.TRUE
, the default, all factor levels not used in the
data will automatically be dropped. If FALSE
, all factor levels
will be shown, regardless of whether or not they appear in the data.facet_wrap_paginate
,
facet_zoom
# Draw a small section of the grid
ggplot(diamonds) +
geom_point(aes(carat, price), alpha = 0.1) +
facet_grid_paginate(color~cut:clarity, ncol = 3, nrow = 3, page = 4)
Run the code above in your browser using DataLab