1

I'm using the following congressional district map:

get_congress_map <- function(cong=113) {
  tmp_file <- tempfile()
  tmp_dir  <- tempdir()
  zp <- sprintf("http://cdmaps.polisci.ucla.edu/shp/districts%03i.zip",cong)
  download.file(zp, tmp_file)
  unzip(zipfile = tmp_file, exdir = tmp_dir)
  fpath <- paste(tmp_dir, sprintf("districtShapes/districts%03i.shp",cong), sep = "/")
  st_read(fpath)
}

cd114 <- get_congress_map(114)

ggplot() + 
  geom_sf(data=cd114.1,aes(geometry = geometry,),inherit.aes=FALSE,alpha=0.9) + 
  scale_fill_gradient(low = "white", high = "black", limits=c(20,80)) +
  theme_void() +
  theme(axis.title.x=element_blank(),
        axis.text.x=element_blank(),
        axis.ticks.x=element_blank(),
        axis.title.y=element_blank(),
        axis.text.y=element_blank(),
        axis.ticks.y=element_blank())

It looks like this : enter image description here

I was wondering how I could reshape it so that Alaska and Hawaii were positioned under the United States as it is in most state maps and remove the outlining landmass on the right side of the plot.

Thank you so much for your help.

Sharif Amlani
  • 1,138
  • 1
  • 11
  • 25
  • Suggested duplicate: [Relocating Alaska and Hawaii on map using ggplot2](https://stackoverflow.com/q/13757771/903061) – Gregor Thomas Jun 04 '20 at 02:13
  • That post used state and not congressional district shapefile. In addition, The congressional district map includes multiple polygons and not latitudes and longitudes. I've still been having great difficulty working with it. – Sharif Amlani Jun 04 '20 at 02:22
  • Have you tried manipulating code from this reference: http://cdmaps.polisci.ucla.edu/tut/mapping_congress_in_R.html – Todd Burus Jun 04 '20 at 03:28

0 Answers0