IniziaInizia gratis

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.

Questo esercizio fa parte del corso

Analyzing US Census Data in R

Visualizza il corso

Istruzioni dell'esercizio

  • 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.

Esercizio pratico interattivo

Prova a risolvere questo esercizio completando il codice di esempio.

# 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")
Modifica ed esegui il codice