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

Fixing labels

Our initial plot displays the data, but there's a lot of work to do before it'll resemble the FiveThirtyEight plot. Let's start with the text above and around the plot. We've seen how the ggplot2 layer labs() can take multiple arguments to modify the text. The plot you created in the previous exercise, initial_plot, has been loaded for you.

Bu egzersiz

Categorical Data in the Tidyverse

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

Egzersiz talimatları

  • To match the FiveThirtyEight graph:
    • Add its title, subtitle, and caption
    • Set the labels for x and y-axis as empty strings
  • Save it as a new plot, titled_plot.

Uygulamalı interaktif egzersiz

Bu örnek kodu tamamlayarak bu egzersizi bitirin.

titled_plot <- initial_plot + 
    # Add the title, subtitle, and caption
    ___(___ = "Hell Is Other People In A Pressurized Metal Tube",
         ___ = "Percentage of 874 air-passenger respondents who said action is very or somewhat rude",
         ___ = "Source: SurveyMonkey Audience", 
         # Remove the x- and y-axis labels
         __ = "", 
         __ = "") 

titled_plot
Kodu Düzenle ve Çalıştır