Load Libraries

library(readr)
library(tidyr)
library(ggplot2)

Load Data Set

I have found an interesting map figure from the “Our World in Data” site. The code to load the datset is below:

gw_potential <- readr::read_csv("https://ourworldindata.org/grapher/global-warming-potential-of-greenhouse-gases-over-100-year-timescale-gwp.csv?v=1&csvType=filtered&useColumnShortNames=true")
## Rows: 6 Columns: 5
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: ","
## chr (1): Entity
## dbl (3): Year, gwp_100, time
## lgl (1): Code
## 
## ℹ Use `spec()` to retrieve the full column specification for this data.
## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
print(gw_potential)
## # A tibble: 6 × 5
##   Entity                     Code   Year gwp_100  time
##   <chr>                      <lgl> <dbl>   <dbl> <dbl>
## 1 Carbon dioxide (CO₂)       NA     2021     1    2021
## 2 HFC-152a (CH₃CHF₂)         NA     2021   164    2021
## 3 Methane (CH₄)              NA     2021    27.9  2021
## 4 Nitrous oxide (N₂O)        NA     2021   273    2021
## 5 PFC-14 (CF₄)               NA     2021  7380    2021
## 6 Sulphur hexafluoride (SF₆) NA     2021 24300    2021

Create Original Plot

The original plot utilizes very simple aesthetics, which makes the plot quite effective. I have replicated the plot below to the best of my abilities. I have even tried to colormatch with exact hexcodes what colors I saw in the original plot.

# create plot

ggplot(gw_potential, aes(x = gwp_100, y = reorder(Entity, gwp_100))) +
  geom_bar(stat = "identity", fill = "#6082A6") +
  geom_text(aes(label = gwp_100), 
            hjust = -0.1, 
            size = 3.5,     
            color = "#636363") +
  labs(
    title = "Global warming potential of greenhouse gases relative to CO₂",
    subtitle = "Global warming potential measures the relative warming impact of one unit mass of a\ngreenhouse gas relative tocarbon dioxide over a 100-year timescale",
    x = "",
    y = ""
  ) +
  theme_minimal() +
  theme(
    panel.grid = element_blank(),
    axis.text.x = element_blank(),
    axis.line.y = element_line(color = "grey", linewidth = 0.2),
    axis.ticks.length = unit(0.2, "cm"),
    plot.title = element_text(
      family = "Times New Roman",
      size = 20,
      color = "#636363"
    ),
  plot.margin = margin(10, 75, 10, 10)
  ) +
  scale_x_continuous(expand = c(0, 0), limits = c(0, NA)) +
  coord_cartesian(xlim = c(0, max(gw_potential$gwp_100) * 1.1))

Improve the original plot

I have chosen to improve the original plot by adding subtitles and axis labels, removing the y-axis line, and adding colors that contain a range of saturations in addition to the already existing direct text.

# improve plot

gw_potential$Entity <- reorder(gw_potential$Entity, -gw_potential$gwp_100)

ggplot(gw_potential, aes(x = gwp_100, y = reorder(Entity, -gwp_100), fill = Entity)) +
  geom_bar(stat = "identity") +
  geom_text(aes(label = gwp_100), 
            hjust = -0.1, 
            size = 3.5,     
            color = "#636363") +
  labs(
   title = "Global warming potential of greenhouse gases",
    subtitle = "Global warming potential (GWP) measures the relative warming impact of one\nunit mass of a greenhouse gas relative tocarbon dioxide over a 100-year timescale",
    x = "GWP",
    y = "Greenhouse Gas"
  ) +
  theme_minimal() +
  theme(
    panel.grid = element_blank(),
    axis.text.x = element_blank(),
    axis.ticks.length = unit(0.2, "cm"),
    plot.title = element_text(
      family = "Times New Roman",
      size = 20,
      color = "#636363"
    ),
  plot.margin = margin(10, 75, 10, 10),
  legend.position = c(0.7, 0.6), 
    legend.background = element_rect(fill = "white", color = "grey", size = 0.5), 
    legend.key.size = unit(0.6, "cm") 
  ) +
  scale_x_continuous(expand = c(0, 0), limits = c(0, NA)) +
  coord_cartesian(xlim = c(0, max(gw_potential$gwp_100) * 1.1)) +
  scale_fill_brewer(palette = "RdYlGn")
## Warning: The `size` argument of `element_rect()` is deprecated as of ggplot2 3.4.0.
## ℹ Please use the `linewidth` argument instead.
## This warning is displayed once every 8 hours.
## Call `lifecycle::last_lifecycle_warnings()` to see where this warning was
## generated.
## Warning: A numeric `legend.position` argument in `theme()` was deprecated in ggplot2
## 3.5.0.
## ℹ Please use the `legend.position.inside` argument of `theme()` instead.
## This warning is displayed once every 8 hours.
## Call `lifecycle::last_lifecycle_warnings()` to see where this warning was
## generated.

Explain improvements

I have elected to recreate and improve upon a graph from Our World in Data that compares various greenhouse gases to CO2 in terms of their global warming potentials. Here is the link to the original graph: https://ourworldindata.org/grapher/global-warming-potential-of-greenhouse-gases-over-100-year-timescale-gwp

The graph was already very well designed. There were no unnecessary grid lines in the middle of the plot or distracting colors or extra labels. I also appreciate the direct labeling on the bars to convey the values. I chose to amend parts of the chart that perhaps were not necessary changes, but in my opinion they add some value. I chose to slightly amend the subtitle to include the abbreviation used in the data set (GWP) that I then use as my x axis title. I understand that this may not be a necessary change but I think there is value in familiarizing the audience with that abbreviation. I also reversed the order that the gases appear in top to bottom so that the GWP increases as you look down the chart. This organization makes more sense because if CO2 is the basis for comparison it should appear at the top, and the worsening gas types should increase in GWP as the graph continues down. The next change I made was in the colors. I appreciate how simple the original graph kept the colors, however I believe it is interesting to portray urgency with color, especially for a climate change related graph. I therefore chose to use a scale of reds to greens to show that sulphur hexaflouride is more dangerous than we may be treating it. I intentionally chose colors of different saturation to help those with colorblindness, but I acknowledge that the red-green scale is not good for duterentopes (people with red-green color blindness). However, the direct labeling and size-scaling of the bars convey plenty of information on their own, I was just seeking to experiment with different impacts that the data can make. In adding color differences I also added a legend that describes which color represents which bar visually. This legend was appearing in inconvenient places at first so I moved it to fit snugly on the graph but out of the way of the important elements. I also added simple axis labels to orient the reader. Finally, I removed the faint y-axis line, and let the carbon dioxide standalone label “1” speak for itself, as the grey line made it difficult to see any visual difference between the methane and the carbon dioxide, when in reality they are quite different in GWP value. I believe that the original creator of this graph did an excellent job of simplifying the chart down to its essential elements, and for the sake of this project I was interested in discovering what other elements I could add to make the chart more visually interesting or more impactful. I understand that this may make the graph less immediately digestable, but I belive there is some value in my additions!