1. Learn
  2. /
  3. Courses
  4. /
  5. Intermediate Data Visualization with ggplot2

Exercise

Wind rose plots

Polar coordinate plots are well-suited to scales like compass direction or time of day. A popular example is the "wind rose".

The wind dataset is taken from the openair package and contains hourly measurements for windspeed (ws) and direction (wd) from London in 2003. Both variables are factors.

Instructions 1/3

undefined XP
    1
    2
    3
  • Make a classic bar plot mapping wd onto the x aesthetic and ws onto fill.
  • Use a geom_bar() layer, since we want to aggregate over all date values, and set the width argument to 1, to eliminate any spaces between the bars.