Skip to content

Instantly share code, notes, and snippets.

@samclifford
Created June 25, 2017 13:58
Show Gist options
  • Save samclifford/5b3749aa0d6dfa81b31723a4246b6a7f to your computer and use it in GitHub Desktop.
Save samclifford/5b3749aa0d6dfa81b31723a4246b6a7f to your computer and use it in GitHub Desktop.
Wheat plot
library(tidyverse)
tibble(x = rnorm(n=100)) %>%
arrange(x) %>%
mutate(bin = base::cut(x, breaks=pretty(x,n=20))) %>%
group_by(bin) %>%
mutate(count = 1:n()) %>%
ggplot(data=., aes(x=x, y=count)) +
geom_path(aes(group=bin)) +
geom_point(size=0.5) +
ylim(c(0,NA))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment