Trying to make a chloropleth map of the US. Fill for each state should be one color of varying darkness depending on the value for each respective state in the column assigned to it. Instead of a gradient scale in one color, I get a rainbow of colors with each individual value having its own distinct color on the rainbow scale. The legend is three columns of rainbow gradient colors with each distinct value having its own color instead of a small bar with a gradient of one color and a range of values.
library(ggplot2)
library(maps)
suppressMessages(library(ggmap))
library(mapproj)
suppressMessages(library(dplyr))
Get map data for US states
states_map <- map_data("state")
Create lowercase state names
Cats_vs_Dogs <- mutate(Cats_vs_Dogs, Location = tolower(Location))
ggplot(data=Cats_vs_Dogs, aes(fill = Cat.Population)) +
geom_map(map = states_map, aes(map_id = Location), color="white", size=0.3) +
expand_limits(x = states_map$long, y = states_map$lat) +
coord_map("polyconic") +
theme_void() +
ggtitle("2018 US Cat Populations By State")