I am mapping two independent shapefiles and trying to build a custom legend with the necessary colors. The colors in the legend are not matching what is in the scale_color_manual command. Here is the script:
plot <- ggplot() + geom_sf(data = Vista_rebuf, col = "maroon", fill = "purple", show.legend = TRUE) + geom_sf(data = Reno_rebuf, col = "dark green", fill = "green", show.legend = TRUE)
plot + ggspatial::annotation_scale( location = "br", bar_cols = c("grey60", "white")) +
ggspatial::annotation_north_arrow(location = "br", which_north = "true", pad_x = unit(0.1, "in"), pad_y = unit(0.3, "in"),
style = ggspatial::north_arrow_nautical(fill = c("grey40", "white"),line_col = "grey20")) +
ggtitle("RFC Forecasting Area") + theme(plot.title = element_text(hjust = 0.5)) +
scale_color_manual(values = c("Vista" = "purple", "Reno" = "green"), breaks = c("Reno", "Vista")) +
theme(legend.title = element_text(size = 20), legend.text = element_text(size = 14))
This is what it is producing:
Why isn't the Vista box in the legend purple?
