Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/wilkox/ggwrap
🌯 Wrap ggplot2 plots over multiple rows
https://github.com/wilkox/ggwrap
Last synced: 2 months ago
JSON representation
🌯 Wrap ggplot2 plots over multiple rows
- Host: GitHub
- URL: https://github.com/wilkox/ggwrap
- Owner: wilkox
- Created: 2018-06-07T09:03:15.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-02-12T04:08:30.000Z (almost 6 years ago)
- Last Synced: 2024-07-31T19:25:58.094Z (6 months ago)
- Language: R
- Homepage:
- Size: 435 KB
- Stars: 44
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.Rmd
Awesome Lists containing this project
- awesome-r-dataviz - ggwrap - Wrap ggplot2 plots over multiple rows. (ggplot / Miscellaneous)
README
---
output:
github_document:
html_preview: true
toc: true
fig_width: 8
fig_height: 8
---```{r, echo = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-"
)
```[![Travis-CI Build Status](https://travis-ci.org/wilkox/ggwrap.svg?branch=master)](https://travis-ci.org/wilkox/ggwrap)
[![CRAN_Status_Badge](http://www.r-pkg.org/badges/version/ggwrap)](https://cran.r-project.org/package=ggwrap)
[![lifecycle](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://www.tidyverse.org/lifecycle/#experimental)'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:
```{r eval = F}
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.
```{r}
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.
```{r}
ggwrap(plot, 4)
```