How to create spirals in cartesian coordinates with ggplot2 in R (CC222)

June 16, 2022 • PD Schloss • 1 min read

In this episode Pat will show you how to create spirals in cartesian coordinates using ggplot2 without the aid of coord_polar. He’ll then use this strategy to recreate one of the climate spirals. Get ready for some trigonometry! While coord_polar was a lot easier to use, this will set us up well for developing related data visualizations. This will all be done using animated climate spirals of monthly temperature anomalies by month using NASA’s GISS data using tools from the ggplot2 and gganimate R packages. This figure shows the deviation in annual global mean temperatures from the normalized temperatures of 1951 to 1980 as a line plot. The lines are colored according to the size of the temperature anomaly. He uses transition_reveal, geom_path, and a smattering of arguments from the theme function to create this provocative visual. All of this is done in R with the help of RStudio.

Code

You can browse the state of the repository at the

comments powered by Disqus