facet_wrap2 | R Documentation |
This function behaves like ggplot2::facet_wrap()
, but has a few
extra options on axis drawing when scales are fixed.
facet_wrap2(
facets,
nrow = NULL,
ncol = NULL,
scales = "fixed",
axes = "margins",
remove_labels = "none",
shrink = TRUE,
labeller = "label_value",
as.table = TRUE,
drop = TRUE,
dir = "h",
strip.position = "top",
trim_blank = TRUE,
strip = strip_vanilla()
)
facets |
A set of variables or expressions quoted by For compatibility with the classic interface, can also be a
formula or character vector. Use either a one sided formula, |
nrow , ncol |
Number of rows and columns. |
scales |
A
|
axes |
A
|
remove_labels |
A
|
shrink |
If |
labeller |
A function that takes one data frame of labels and
returns a list or data frame of character vectors. Each input
column corresponds to one factor. Thus there will be more than
one with |
as.table |
If |
drop |
If |
dir |
Direction: either |
strip.position |
By default, the labels are displayed on the top of
the plot. Using |
trim_blank |
A |
strip |
An object created by a call to a strip function, such as
|
A Facet
ggproto object that can be added to a plot.
Other facetting functions:
facet_grid2()
,
facet_manual()
,
facet_nested_wrap()
,
facet_nested()
p <- ggplot(mpg, aes(displ, hwy)) + geom_point()
# Repeat all axes for every facet
p + facet_wrap2(vars(class), axes = "all")
# Repeat only y-axes
p + facet_wrap2(vars(class), axes = "y")
# Repeat axes without labels
p + facet_wrap2(vars(class), axes = "all", remove_labels = "all")
# Repeat axes without x-axis labels
p + facet_wrap2(vars(class), axes = "all", remove_labels = "x")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.