Skip to content

Instantly share code, notes, and snippets.

@rafapereirabr
Last active May 2, 2019 23:14
Show Gist options
  • Save rafapereirabr/b360b92dbaad4d78aef26c612d2ffcfe to your computer and use it in GitHub Desktop.
Save rafapereirabr/b360b92dbaad4d78aef26c612d2ffcfe to your computer and use it in GitHub Desktop.
Simple code to create a world map of cities with population > than 40K in R
library(tidyverse)
library(maps)
temp <- maps::world.cities %>%
ggplot() +
geom_point(aes(x=long, y=lat, size=pop, fill=pop, color=pop), alpha=.1, show.legend = FALSE) +
theme_void() +
coord_equal()
ggsave( temp, file="pop.png", dpi = 300, width = 20, height = 10)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment