CommencerCommencer gratuitement

Customizing the map output

Now that you've chosen an appropriate color palette for your choropleth map of median home values by Census tract in Marin County, you'll want to customize the output. In this exercise, you'll clean up some map elements and add some descriptive information to provide context to your map.

Cet exercice fait partie du cours

Analyzing US Census Data in R

Afficher le cours

Instructions

  • Set the color guide to FALSE to avoid double-plotting of the legend.
  • Add an informative subtitle to your map.
  • Add an informative caption to your map.

Exercice interactif pratique

Essayez cet exercice en complétant cet exemple de code.

# Set the color guide to FALSE and add a subtitle and caption to your map
___(marin_value, ___(fill = estimate, color = ___)) + 
  ___() + 
  scale_fill_viridis_c(labels = scales::dollar) +  
  scale_color_viridis_c(guide = ___) + 
  theme_minimal() + 
  coord_sf(crs = 26911, datum = NA) + 
  labs(title = "Median owner-occupied housing value by Census tract", 
       ___ = "Marin County, California", 
       ___ = "Data source: 2012-2016 ACS.\nData acquired with the R tidycensus package.", 
       fill = "ACS estimate")
Modifier et exécuter le code