Get boundaries to come through on states

前端 未结 1 1918
深忆病人
深忆病人 2021-01-27 07:08

Edit 7 :

After quite a bit of help, I\'ve been able to get a map that is getting close to the results I need. But I still need to have the state boundaries come throug

相关标签:
1条回答
  • 2021-01-27 08:14

    The order in which you draw the layers matters. If you want the while lines on top, you'll need to add them last. And if you want the black shapes in the background, you need them first. So basically you need to split up the states into two draws: the background and the outline.

    ggplot() + 
      geom_polygon(data=subset(map_data("state"), region %in% regions), aes(x=long, y=lat, group=group)) +
      geom_point(data = PRISM_1895_db, aes(x = longitude, y = latitude, color = APPT), alpha = .5, size = 3.5) +
      geom_polygon(data=subset(map_data("state"), region %in% regions), aes(x=long, y=lat, group=group), color="white", fill=NA)
    

    which produces

    enter image description here

    0 讨论(0)
提交回复
热议问题