ggplot2 mapping county boundries in one color and state boundries in another on the same map

前端 未结 1 1191
鱼传尺愫
鱼传尺愫 2021-02-04 18:45

I am creating a choropleth county map with grey borders, and I also want to include the state boundries in black. Does anyone know how I go about adding a second layer of state

相关标签:
1条回答
  • 2021-02-04 19:38

    Just add a geom_path to your code...

    I used red to highlight the boundaries but you can easily just set it to black.

        ggplot( wip_map, aes( x = long , y = lat , group=group ) ) +
            geom_polygon( colour = "grey" , aes( fill = factor( CATEGORY ) ) ) +
            scale_fill_manual( values = pal ) +
            expand_limits( x = wip_map$long, y = wip_map$lat ) +
            coord_map( "polyconic" ) + 
            labs(fill="Number Per\nCounty") + 
            theme_clean( ) +
            geom_path( data = state_map , colour = "red")
    

    enter image description here

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