There have been a lot of climate change articles recently, and many feature distinctive stacked line charts that summarize data over many decades. Here’s an example from the Climate Reanalyzer that shows how sea temperatures over the last year-and-a-half have been well above average :
And here’s a similar chart from Dr. Zachary Labe’s site showing the extent of Antarctic Sea ice over the last 40+ years :
These charts have become a popular choice for infographics, such as in this article, but this popularity is a bit surprising . Due to the difficulty in following individual lines through these dense, tangled displays, they’re generally shunned and disparaged as “spaghetti” plots.
But there’s a secret to using spaghetti plots successfully. You must emphasize one or two lines against a diminished background of all the other lines. This strategy lets you place the selected lines within an overall context. Do they represent normal outcomes or are they outliers? Are the results really good or really bad? By superimposing them on a background trend, the story can write itself.
In this Quick Success Data Science project, we’re going to produce a facsimile of the previous Antarctic Sea Ice chart with the Plotly Express graphing library. With this code example, you should be able to generate similar plots for your own datasets.
For data we’ll use a comprehensive public dataset compiled by the National Snow and Ice Data Center, a part of the Cooperative Institute for Research in Environmental Sciences (CIRES) at the University of Colorado, Boulder . This dataset utilizes satellite imagery to track and monitor changes in polar sea ice, such as the “halo” of ice around Antarctica.