Created
July 11, 2019 14:45
-
-
Save jmcastagnetto/13ff89806d268fd05154c77c18656783 to your computer and use it in GitHub Desktop.
R code to draw the flag of Peru
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
| library(tidyverse) | |
| df <- data.frame( | |
| x1 = 0:2, x2 = 1:3, | |
| y1 = rep(0, 3), y2 = rep(2, 3), | |
| color = c("r", "w", "r")) | |
| ggplot(df) + | |
| geom_rect(aes(xmin = x1, xmax = x2, | |
| ymin = y1, ymax = y2, | |
| fill = color) | |
| ) + | |
| scale_fill_manual( | |
| values = c("red", "white", "red"), | |
| guide = FALSE | |
| ) + | |
| labs(title ="Julio: mes patrio en el Perú", | |
| subtitle = "¡Feliz 28 de Julio!", | |
| caption = "Jesús M. Castagnetto (@jmcastagnetto)") + | |
| theme_void() + | |
| theme( | |
| plot.title = element_text( | |
| hjust = 0.5, | |
| family = "Latin Modern Roman Caps", | |
| size = 24 | |
| ), | |
| plot.subtitle = element_text( | |
| hjust = 0.5, | |
| family = "Latin Modern Roman Caps", | |
| size = 20 | |
| ) | |
| ) | |
| ggsave("peru-bandera-r.png", width = 9, height = 6) |
Author
jmcastagnetto
commented
Jul 11, 2019

Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment