13.19 Making a Map with a Clean Background

13.19.1 Problem

You want to remove background elements from a map.

13.19.2 Solution

Use theme_void() (Figure 13.38). In this example, we’ll add it to one of the choropleths we created in Recipe 13.18:

ggplot(crimes, aes(map_id = state, fill = Assault_q)) +
  geom_map(map = states_map, colour = "black") +
  scale_fill_manual(values = pal) +
  expand_limits(x = states_map$long, y = states_map$lat) +
  coord_map("polyconic") +
  labs(fill = "Assault Rate\nPercentile") +
A map with a clean background

Figure 13.38: A map with a clean background

13.19.3 Discussion

In some maps, it’s important to include contextual information such as the latitude and longitude. In others, this information is unimportant and distracts from the information that’s being conveyed. In Figure 13.38, it’s unlikely that viewers will care about the latitude and longitude of the states. They can probably identify the states by shape and relative position, and even if they can’t, having the latitude and longitude isn’t really helpful.