1. Learn
  2. /
  3. Courses
  4. /
  5. Visualization Best Practices in R

Exercise

A basic ridgeline plot

Supplied is code to make a ridgeline plot looking at the percentage over the limit drivers were pulled over going by day of the week.

Modify the code to set the kernel width (bandwidth) to a specified value, change the x-axis limits to get rid of the long tails, and also add a subtitle letting the reader know the bandwidth you are using.

Instructions

100 XP
  • Change the bandwidth to 3.5 in geom_density_ridges().
  • Set the limits of the x-scale to 0 to 150.
  • Give plot the subtitle 'Gaussian kernel SD = 3.5'.