I'm using ggplot to map some data on a gradient scale and I want to produce a map of the US with HUC boundaries and corresponding data. I know how to do it with states, yielding an image of the US, with each state having a different color, representing a different value using this code:
data("fifty_states")
states <- read_csv("mapping - Sheet1-4.csv")
low_color='green'
high_color="blue"
legend_title = 'Slope'
ggplot(states, aes(map_id = State)) +
geom_map(aes(fill = Sen_Slope_Color_10 ),color="#ffffff",size=.15, map = fifty_states) +
expand_limits(x = fifty_states$long, y = fifty_states$lat) +
coord_map() +
labs(x = "", y = "") +
scale_x_continuous(breaks = NULL) +
scale_y_continuous(breaks = NULL) +
scale_fill_continuous(low = low_color, high= high_color, guide = guide_colorbar(title = legend_title)) + # creates shading pattern
theme(#legend.position = "bottom",
panel.background = element_blank()) +
fifty_states_inset_boxes()
Here is a look at the data: States data
I want to do the same thing, but doing it with HUC (watershed boundaries). Does anyone know how to modify this code to do that?