BaşlayınÜcretsiz Başlayın

Customizing geom_sf() plots

As you've learned in previous chapters, it is a good idea to clean up and format your ggplot2 visualizations before sharing with others. In this exercise, you'll make some modifications to your map of Texas House districts such as removing the gridlines and adding an informative title.

Bu egzersiz

Analyzing US Census Data in R

kursunun bir parçasıdır
Kursu Görüntüle

Egzersiz talimatları

  • Specify that you'll be drawing a ggplot, with the legislative district fill set to Party.
  • Set the datum to NA in coord_sf() to remove the gridlines behind the map.
  • Give the map an informative title.

Uygulamalı interaktif egzersiz

Bu örnek kodu tamamlayarak bu egzersizi bitirin.

# Draw a ggplot without gridlines and with an informative title
___(tx_joined, ___(___ = Party)) + 
  ___() + 
  coord_sf(crs = 3083, ___ = NA) + 
  ___(values = c("R" = "red", "D" = "blue")) + 
  theme_minimal(base_size = 16) + 
  labs(___ = "State House Districts in Texas")
Kodu Düzenle ve Çalıştır