Skip to content

Instantly share code, notes, and snippets.

@jimmylovestea
Created October 20, 2017 05:33
Show Gist options
  • Save jimmylovestea/9e7e98fa53c1eaa3bf8a20640010b0b2 to your computer and use it in GitHub Desktop.
Save jimmylovestea/9e7e98fa53c1eaa3bf8a20640010b0b2 to your computer and use it in GitHub Desktop.
## In response to: https://twitter.com/ewijaya_/status/921178681069809664
# Load ggplot2
library(ggplot2)
# Start by creating a data frame similar to that found in the plot
x = LETTERS[1:4]
y = letters[1:8]
df <- expand.grid(x, y)
names(df) <- c("x", "y")
df$w = runif(nrow(df))
df$z = sample(c(letters[10:14]), size = nrow(df), replace = TRUE)
# Make the plot
ggplot(df) +
geom_point(aes(x = x, y = y, color = z, size = w)) +
theme_minimal()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment