Skip to content

Instantly share code, notes, and snippets.

@atusy
Created February 18, 2019 13:29
Show Gist options
  • Save atusy/71ec8fc0be3a87b9bf796e4007664e6c to your computer and use it in GitHub Desktop.
Save atusy/71ec8fc0be3a87b9bf796e4007664e6c to your computer and use it in GitHub Desktop.
---
output: html_document
---
```{r, fig.width = 7, fig.height = 4, cache = TRUE}
library(readr)
library(ggplot2)
library(patchwork) # remotes::install_github("thomasp85/patchwork")
d <- read_csv("https://gist.githubusercontent.com/atusy/eca1f1acb31720896660a9926adab756/raw/5b4643dabb9499459cedb0673ad4fe780568143d/example4geom-col.csv")
p <- ggplot(d, aes(x, n)) + geom_col(width = 1)
patchwork::wrap_plots(
p + coord_cartesian(xlim = c(1500, 2500)),
p + coord_cartesian(xlim = c(2000, 2200)),
p + coord_cartesian(xlim = c(2000, 2050)),
nrow = 1
)
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment