Drawing NYT’s spiral plot in Stata

Asjad Naqvi
The Stata Gallery
Published in
6 min readJun 17, 2022

--

In this guide we will learn to make the following spiral plot in Stata:

This figure first appeared in the New York Times in Jan 2022 and caused quite a bit of a controversy. First, the spiral itself makes it hard to compare the values. For example, the intersections represent 2020, 2021, and 2022 going from inside out. Therefore, the scales vary. Second, graphs made in polar coordinates are never a favorite due to the distortions they create. And this graph definitely polarized the dataviz community even more. Just google it and you will find out!

But here our aim is to create the figure in Stata, which in itself is an interesting coding challenge. A modification we have made here, is that, instead of only showing cases centered around the spiral, as in the original NYT article, cases and deaths are mirrored on the spiral line. This little tweak makes a the figure a bit richer since it allows us to see how the COVID-19 waves appeared over time.

Before we get started

The coding steps provided in this guide are discussed in various articles in the Polar section of the Stata Guide. This includes dealing with polar coordinates, data transformations, rotations etc. So if you get stuck please read those carefully.

--

--

Asjad Naqvi
The Stata Gallery

Here you will find stuff on Stata, data visualizations, data wrangling, workflows, and programming.