| scale_wrap | R Documentation |
This scale function wraps a 'gg' plot over multiple rows to make plots with long x axes easier to read.
scale_wrap(n)
n |
the number of subplot pieces. |
A plot can be broken on both axes (scale_x_break() with scale_y_break()), but a wrapping, breaking or cutting scale cannot be combined with a different one of them.
gg object
library(ggplot2)
library(ggbreak)
p <- ggplot(economics, aes(x=date, y = unemploy, colour = uempmed)) +
geom_line()
p + scale_wrap(n=4)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.