‘ggwrap’ wraps a ‘ggplot2’ plot over multiple rows, to make plots with long x axes easier to read.
The development version of ‘ggwrap’ can be installed from GitHub:
devtools::install_github("wilkox/ggwrap")
The ggwrap
function takes two arguments: a ‘ggplot2’ plot, and the
number of rows over which the plot should be wrapped.
Here’s a simple plot.
library(ggplot2)
library(ggwrap)
plot <- ggplot(economics, aes(x = date, y = unemploy, colour = uempmed)) +
geom_line()
plot
We can use ggwrap
to wrap the plot over four rows.
ggwrap(plot, 4)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.