Skip to content
🌯 Wrap ggplot2 plots over multiple rows
R
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
R
man
tests
.Rbuildignore
.gitignore
.travis.yml
DESCRIPTION
NAMESPACE
NEWS.md
README.Rmd
README.md

README.md

Travis-CI Build Status CRAN_Status_Badge lifecycle

‘ggwrap’ wraps a ‘ggplot2’ plot over multiple rows, to make plots with long x axes easier to read.

Installation

The development version of ‘ggwrap’ can be installed from GitHub:

devtools::install_github("wilkox/ggwrap")

Usage

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)

You can’t perform that action at this time.