Last active
June 16, 2018 02:17
-
-
Save kevinsoo/48bd150cf1993a729851aa16320736f8 to your computer and use it in GitHub Desktop.
This code plots a ketupat on a graph for Hari Raya consumption.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #### 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