0

I am making a choropleth using ggplot2 with the county dataset. The data I am tying in to the county data is only for a handful of counties. My questions is: how can I change the default grey fill for the counties in which I don't have data? In the merged dataset there are just na's for the mapped values in the grey counties.

Code:

ggplot(data, aes(long, lat, group=group)) +
  geom_polygon(aes(fill=`Surface Mines`), col="grey") +
  coord_map("polyconic") +
  scale_fill_continuous(low="yellow", high="red") +
  geom_path(data=state , colour="black") +
  theme_void()

Output: enter image description here

moman822
  • 1,904
  • 3
  • 19
  • 33
  • 3
    Did you check out the `?scale_fill_continuous` help page? There is a `na.value=` parameter you can pass to set the missing color. – MrFlick Jun 10 '16 at 20:31
  • @MrFlick That'll do it- thanks! Put it down as an answer if you like and I'll mark it correct. – moman822 Jun 10 '16 at 20:38

0 Answers0