LoslegenKostenlos loslegen

Editing plot text

While our initial plot is a good start, there's a lot more we'll want to do to get it ready for "prime time." Let's start by making the x-axis readable, changing the axis labels, and making the y-axis ticks percentage.

The dataset usefulness_by_platform has been loaded for you.

Diese Übung ist Teil des Kurses

Categorical Data in the Tidyverse

Kurs anzeigen

Anleitung zur Übung

  • Change the x-axis text to be rotated 90 degrees.
  • Change the x-axis label to "Learning Platform" and y-axis label to "Percent finding at least somewhat useful".
  • Change the y-axis scale to be a percentage.

Interaktive Übung

Versuche dich an dieser Übung, indem du diesen Beispielcode vervollständigst.

ggplot(usefulness_by_platform, aes(x = learning_platform, y = avg_usefulness)) + 
    geom_point() + 
    # Rotate x-axis text by 90 degrees
    theme(___ = element_text(angle = __, hjust = 1)) + 
    # Rename y and x axis labels
    labs(___ "Learning Platform", ___ "Percent finding at least somewhat useful") + 
    # Change y axis scale to percentage
    ___(labels = scales::scales::percent_format())
Code bearbeiten und ausführen