Session Ready
Exercise

Separating a lot of bands

It is relatively simple to plot a bunch of trend lines on top of each other for rapid and precise comparisons. Unfortunately, if you need to add uncertainty bands around those lines, the plot becomes very difficult to read. Figuring out whether a line corresponds to the top of one class' band or the bottom of another's can be hard due to band overlap. Luckily in Seaborn, it's not difficult to break up the overlapping bands into separate faceted plots.

To see this, explore trends in SO2 levels for a few cities in the eastern half of the US. If you plot the trends and their confidence bands on a single plot - it's a mess. To fix, use Seaborn's FacetGrid() function to spread out the confidence intervals to multiple panes to ease your inspection.

Instructions
100 XP
  • Set up a facet grid to separate the plots by the city column in eastern_SO2.
  • Send the confidence interval plotting function to map().
  • Color the confidence intervals 'coral'.
  • Help the overlaid mean line drawn with g.map(plt.plot,...) stand out against the confidence bands by coloring it white.