Created
August 31, 2025 23:56
-
-
Save thoughtfulbloke/0b0bbbf946ec7dcdf831e662f592ddb0 to your computer and use it in GitHub Desktop.
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(ggplot2) | |
| library(maps) | |
| library(dplyr) | |
| # while the position data in the maps package | |
| # is very basic, that makes it simple to transform | |
| nz_map <- map_data("nz") | |
| nz_anti <- nz_map %>% | |
| mutate( | |
| lat = -lat, | |
| long = ifelse(long > 0, long - 180, long + 180) | |
| ) | |
| the_world <- map_data("world") | |
| ggplot() + | |
| geom_polygon(data = the_world, aes(x = long, y = lat, group = group), | |
| fill = "cornsilk", color = "black") + | |
| geom_polygon(data = nz_anti, aes(x = long, y = lat, group = group), | |
| fill = "#CC0000AA", color = "black") + | |
| coord_quickmap(xlim = c(-15,15), ylim=c(30,50)) + | |
| labs(title = "Aotearoa Antipodised\n") + | |
| theme_void() | |
| ggsave(filename="~/Desktop/amap.jpg", | |
| height=4.5, width = 8, dpi=150, units = "in", bg = "white") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment