Session Ready
Exercise

Cleaning up bands for overlaps

You are working for the city of Denver, Colorado and want to run an ad campaign about how much cleaner Denver's air is than Long Beach, California's air. To investigate this claim, you will compare the SO2 levels of both cities for the year 2014 (provided as the DataFrame SO2_compare). Since you are solely interested in how the cities compare, you want to keep the bands on the same plot. To make the bands easier to compare, decrease the opacity of the confidence bands and set a clear legend.

Instructions
100 XP
  • Filter the SO2_compare to the for loop's currently selected city.
  • Color both the intervals and mean lines with the color accompanying each city.
  • Lower the interval and mean line opacities to 0.4 and 0.25, respectively.
  • Override the default legend labels in plt.plot() by setting the label argument to the city name.