Skip to content

Instantly share code, notes, and snippets.

@aleszu
Created May 16, 2018 15:37
Show Gist options
  • Save aleszu/276dc7c8765a8d6d037b628ad68a82fb to your computer and use it in GitHub Desktop.
Save aleszu/276dc7c8765a8d6d037b628ad68a82fb to your computer and use it in GitHub Desktop.
library(ggplot2)
library(tidyverse)
library(fiftystater)
mapdata <- read.csv("state-medal-count.csv", header=TRUE, stringsAsFactors=FALSE)
mapdata %>% glimpse()
data("fifty_states")
ggplot() + geom_polygon( data=fifty_states, aes(x=long, y=lat, group = group),color="white", fill="grey10" )
ggplot() + geom_polygon(data=fifty_states, aes(x=long, y=lat, group = group),color="white", fill="grey92" ) +
geom_point(data=mapdata, aes(x=lon, y=lat, size = medals), color="black") +
scale_size(name="", range = c(2, 20)) +
guides(size=guide_legend("GABF medals 1985-2015")) +
theme_void()
ggsave("beermap.png", width=14.4,height=7.43,units="in")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment