Skip to content

Instantly share code, notes, and snippets.

@kevinsoo
Last active June 16, 2018 02:17
Show Gist options
  • Select an option

  • Save kevinsoo/48bd150cf1993a729851aa16320736f8 to your computer and use it in GitHub Desktop.

Select an option

Save kevinsoo/48bd150cf1993a729851aa16320736f8 to your computer and use it in GitHub Desktop.
This code plots a ketupat on a graph for Hari Raya consumption.
#### Code for making ketupat
#### By Kevin Soo
library(tidyverse)
data <- tibble(
x = c(2, 3, 3, 4, 4, 4, 5, 5, 6) + 1,
y = c(3, 4, 2, 5, 3, 1, 4, 2, 3) + 2,
z = as.factor(c(1, 2, 2, 1, 1, 1, 2, 2, 1))
)
data %>%
ggplot(aes(x = x, y = y)) +
geom_point(shape = 23, size = 18, aes(fill = z)) +
scale_x_continuous(limits = c(0, 10)) +
scale_y_continuous(limits = c(0, 10)) +
scale_fill_manual(values = c("darkolivegreen2", "khaki1")) +
guides(fill = FALSE) +
theme_minimal() +
labs(title = "Selamat Hari Raya from DataTarik",
subtitle = "Maaf zahir dan batin",
x = "X",
y = "Y")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment