I am trying to produce a choropleth map using geom_map in ggplot2. I want to outline the various regions in black or some other color to distinguish between areas that are similar in color on the gradient. Using the following code I ve tried to set the color to outline the areas. The code produces the map, but no borders. When I move the colour command into the aesthetic it produces the expected pink borders with a legend. Any ideas why setting the color won t produce borders, but mapping will? I saw a similar discussion on the ggplot2 Google Group.
ggplot(subset(df, as.character(variable) == "value"), aes(map_id = id)) +
geom_map(aes(fill = pct), colour = "black", map = ggmap) +
expand_limits(x = ggmap$long, y = ggmap$lat) +
scale_fill_gradient(low = "antiquewhite", high = "darkred") +
opts(title = "Title", panel.background = theme_rect(fill = "grey90"))
成就