Programming a line plot in R to show climate change with and without animation (CC225)

June 27, 2022 • PD Schloss • 1 min read

Pat shares how he would use r programming to recreate a line plot displaying climate change by month and year using ggplot2. The data depicted are monthly temperature anomalies by month using NASA’s GISS data using tools from the ggplot2 R package. This figure shows the deviation in annual global mean temperatures from the normalized temperatures of 1980 to 2015 as a series of lines created using ggplot2’s geom_line function. The lines are colored according to the average temperature anomaly for the year with scale_color_gradient2. Finally, he shows how he would animate the figure with tools from gganimate. All of this is done in R with the help of RStudio.


You can browse the state of the repository at the