Exercise

Adjusting your palette according to context

You've been asked to make a figure for your company's website. The website has a slick black theme, and it would be pretty jarring if your plot were white. To make your plot match the company aesthetic, you can swap the background to a black one with plt.style.use("dark_background").

The figure you've been asked to make plots O3 values during October 2015 for various cities (provided as oct_2015_o3). You will plot this as a heatmap with the color of each cell encoding how many standard deviations from the overall average O3 value the measurement falls. Due to the website's dark background, you will want to adjust your color palette to encode null value (or 0 standard deviations from the mean) as dark rather than the default white.

Instructions

100 XP
  • Set the theme of the plot to be dark with plt.style.use().

    • You can see the available themes for plt.style.use() by running the line plt.style.available; look for the one that will make your background dark.
  • Modify the custom palette to be 'dark' for the center value instead of the default white.