Skip to content

Instantly share code, notes, and snippets.

@vpnagraj
Created January 4, 2018 16:52
Show Gist options
  • Save vpnagraj/091fb4fd1d44a694c8fdbbb51ba65e92 to your computer and use it in GitHub Desktop.
Save vpnagraj/091fb4fd1d44a694c8fdbbb51ba65e92 to your computer and use it in GitHub Desktop.
scale exploration
library(ggplot2)
library(tidyr)
dat <- data.frame(x = rnorm(n = 1000, mean = 2.8, sd = 0.05),
y1 = sample(64503:73034, size = 1000, replace = TRUE),
y2 = sample(18738:19602, size = 1000, replace = TRUE))
dat %>%
ggplot() +
geom_point(aes(x,y1)) +
geom_point(aes(x,y2))
dat %>%
gather(var, val,-x) %>%
ggplot(aes(x,val)) +
geom_point() +
facet_wrap(~var, scales = "free_y", ncol = 1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment