The Tangled Bank
  • Home
  • Vignettes
    • Dates From netCDF Files: Two Approaches
    • Downloading and Prep: ERDDAP
    • Retrieving Chlorophyll-a Data from ERDDAP Servers
    • Downloading and Prep: Python + CDO
    • Detecting Events in Gridded Data
    • Regridding gridded data
    • Displaying MHWs and MCSs as Horizon Plots
    • heatwaveR Issues
    • Plotting the Whale Sightings and Chlorophyll-a Concentrations
    • Spatial Localisation, Subsetting, and Aggregation of the Chlorophyll-a Data
    • Wavelet Analysis of Diatom Time Series
    • Extracting gridded data within a buffer
  • High-Performace Computing
    • Using Lengau
    • PBSPro user and job management
    • Using tmux
  • Tangled Bank Blog
  • About
  • Blogroll
    • R-bloggers
    • Source Code
    • Report a Bug

On this page

  • Horizon plots
  • Exploration of the infamous Western Australia heatwave
    • Calculate extreme events
  • Edit this page
  • Report an issue

Event horizon plots

Visualisation of extreme temperature events

Author

AJ Smit

Published

April 1, 2023

Horizon plots

Horizon plots provide a snooty, impactful approach for showing patterns in time series. Because they can be set up to highlight events that occur at certain thresholds, they can be used to show the extreme temperature thresholds as per Hobday et al. (2018) and as shown in Robert Schlegel’s post.

Horizon plots are a type of visualisation technique used to display time series data, particularly when there are multiple overlapping series or when the data have a wide range of values. They are an extension of the traditional line plot and are particularly useful when dealing with large datasets with numerous data points or when trying to visualise data with both large and small variations in value.

In a horizon plot, the data are first divided into bands or layers, which can be either equally spaced or defined by the user. Each layer represents a specific range of data values. The layers are then colour-coded, with the intensity of the colour corresponding to the magnitude of the physical quantity represented by the data within each layer. Next, the layers are collapsed, or overlaid, on top of each other to create a single, compact visualisation.

The primary advantage of horizon plots is that they can display a large amount of data in a small space, making it easier to identify trends, patterns, and extremes. By using colour and layering, horizon plots can reveal variations in the data that might be difficult to discern in other types of plots. Additionally, they can provide a clearer view of multiple time series when they are overlapping or have different magnitudes.

However, standard horizon plots can also be challenging to interpret for those unfamiliar with the technique. The layering and colour-coding can sometimes make it difficult to determine the exact values of the data points, especially when there are many overlapping layers. These graphs are therefore recommended as a first stab view into the patterns contained within the data, and more a fit-for-purpose plots such as an event_lines() is necessary when the deeper insight into the extreme event metrics is required.

The purpose of this vignette is to take inspiration from horizon plots and to create a figure that can be used to visualise extreme events along a long (~40 yr) time series of data. I call them event horizon plots. At this stage I have not been able to create a visual that is a beautiful as the horizon plots of the ggHoriPlot package: that would require modification of the horizon plot geom as it accepts constant thresholds (cut points) whereas heatwaveR works with daily-varying thresholds and categories. So, event horizon plots do not collopse the layers as standard horizon plots do, and they have a time varying baseline. They realy are only a compressed view of normal event lines and geom_flame() (as per heatwaveR). In the end, the idea is not too far different from standard horizon plots. They are the same but different.

Exploration of the infamous Western Australia heatwave

Calculate extreme events

Load the packages and the data. The data are the for a region off Northwest Africa in the Canary Current System. The spatial extent of the data is displayed below.

library(tidyverse)
library(data.table)
library(lubridate)
library(ggHoriPlot)
library(heatwaveR)
library(ggthemes)
library(doParallel) # For parallel processing

source("../R/extreme_event_horizon.R")

Define a colour scheme for the figure:

# Set line colours
lineColCat <- c(
  "Daily" = "grey40",
  "Climatology" = "darkseagreen2",
  "Threshold (90)" = "red3",
  "Threshold (10)" = "blue3"
  )

# Set category fill colours
fillColCat <- c(
  "+ Extreme" = "#2d0000",
  "+ Severe" = "#9e0000",
  "+ Strong" = "#ff6900",
  "+ Moderate" = "#ffc866",
  "- Moderate" = "#C7ECF2",
  "- Strong" = "#85B7CC",
  "- Severe" = "#4A6A94",
  "- Extreme" = "#111433"
  )

Prepare the data: I use the built-in sst_WA dataset with heatwaveR:

events <- thresh_fun(sst_WA)
horizon_plot(events, title = "Extreme temperature timeline, Western Australia")

Reuse

CC BY-NC-SA 4.0

Citation

BibTeX citation:
@online{smit,_a._j.,
  author = {Smit, A. J., and Smit, AJ},
  title = {Event Horizon Plots},
  date = {},
  url = {http://tangledbank.netlify.app/vignettes/MHW_MCS_horizonplots.html},
  langid = {en}
}
For attribution, please cite this work as:
Smit, A. J., Smit A Event horizon plots. http://tangledbank.netlify.app/vignettes/MHW_MCS_horizonplots.html.
Source Code
---
author: "AJ Smit"
date: "`r Sys.Date()`"
title: "Event horizon plots"
subtitle: "Visualisation of extreme temperature events"
bibliography: ../references.bib
csl: ../marine-biology.csl
format:
  html:
    default-image-extension: svg
    code-fold: false
    toc-title: "On this page"
    standalone: true
    toc-location: right
    page-layout: full
    smooth-scroll: true
    anchor-sections: true
    number-sections: false
---

# Horizon plots

[Horizon plots](https://rivasiker.github.io/ggHoriPlot/articles/ggHoriPlot.html) provide a snooty, impactful approach for showing patterns in time series. Because they can be set up to highlight events that occur at certain thresholds, they can be used to show the extreme temperature thresholds as per Hobday et al. (2018) and as shown in [Robert Schlegel's](https://robwschlegel.github.io/heatwaveR/articles/event_categories.html) post.

Horizon plots are a type of visualisation technique used to display time series data, particularly when there are multiple overlapping series or when the data have a wide range of values. They are an extension of the traditional line plot and are particularly useful when dealing with large datasets with numerous data points or when trying to visualise data with both large and small variations in value.

In a horizon plot, the data are first divided into bands or layers, which can be either equally spaced or defined by the user. Each layer represents a specific range of data values. The layers are then colour-coded, with the intensity of the colour corresponding to the magnitude of the physical quantity represented by the data within each layer. Next, the layers are collapsed, or overlaid, on top of each other to create a single, compact visualisation.

The primary advantage of horizon plots is that they can display a large amount of data in a small space, making it easier to identify trends, patterns, and extremes. By using colour and layering, horizon plots can reveal variations in the data that might be difficult to discern in other types of plots. Additionally, they can provide a clearer view of multiple time series when they are overlapping or have different magnitudes.

<!-- My application of horizon plots in this vignette makes them similar to Hovmöller Diagrams, as I display latitude (in my examples) along the $y$-axis and time along $x$. As such, I show the evolution of MHWs and MCSs seasonally, across years, and zonally. -->

However, standard horizon plots can also be challenging to interpret for those unfamiliar with the technique. The layering and colour-coding can sometimes make it difficult to determine the exact values of the data points, especially when there are many overlapping layers. These graphs are therefore recommended as a first stab view into the patterns contained within the data, and more a fit-for-purpose plots such as an `event_lines()` is necessary when the deeper insight into the extreme event metrics is required.

The purpose of this vignette is to take inspiration from horizon plots and to create a figure that can be used to visualise extreme events along a long (~40 yr) time series of data. I call them **event horizon plots**. At this stage I have not been able to create a visual that is a beautiful as the horizon plots of the **ggHoriPlot** package: that would require modification of the horizon plot geom as it accepts constant thresholds (cut points) whereas **heatwaveR** works with daily-varying thresholds and categories. So, event horizon plots do not collopse the layers as standard horizon plots do, and they have a time varying baseline. They realy are only a *compressed* view of normal event lines and `geom_flame()` (as per **heatwaveR**). In the end, the idea is not too far different from standard horizon plots. They are the same but different.

# Exploration of the infamous Western Australia heatwave

## Calculate extreme events

Load the packages and the data. The data are the for a region off Northwest Africa in the Canary Current System. The spatial extent of the data is displayed below.

```{r}
#| message: false
#| warning: false
library(tidyverse)
library(data.table)
library(lubridate)
library(ggHoriPlot)
library(heatwaveR)
library(ggthemes)
library(doParallel) # For parallel processing

source("../R/extreme_event_horizon.R")
```

Define a colour scheme for the figure:

```{r}
# Set line colours
lineColCat <- c(
  "Daily" = "grey40",
  "Climatology" = "darkseagreen2",
  "Threshold (90)" = "red3",
  "Threshold (10)" = "blue3"
  )

# Set category fill colours
fillColCat <- c(
  "+ Extreme" = "#2d0000",
  "+ Severe" = "#9e0000",
  "+ Strong" = "#ff6900",
  "+ Moderate" = "#ffc866",
  "- Moderate" = "#C7ECF2",
  "- Strong" = "#85B7CC",
  "- Severe" = "#4A6A94",
  "- Extreme" = "#111433"
  )
```

Prepare the data: I use the built-in `sst_WA` dataset with **heatwaveR**:

```{r}
events <- thresh_fun(sst_WA)
```

```{r}
#| fig-height: 10
#| fig-width: 8
horizon_plot(events, title = "Extreme temperature timeline, Western Australia")
```

© 2025, AJ Smit

  • Edit this page
  • Report an issue
Cookie Preferences

Made with and Quarto View the source at GitHub