ggtime: A grammar of temporal graphics

Authors

Cynthia A Huang, Mitchell O’Hara-Wild, Rob J Hyndman, Matthew Kay

Published

30 October 2025

Publication details

Working paper

 

Visualizing changes over time is fundamental to learning from the past and anticipating the future. However, temporal semantics can be complicated, and existing visualization tools often struggle to accurately represent these complexities. It is common to use bespoke plot helper functions designed to produce specific graphics, due to the absence of flexible general tools that respect temporal semantics. We address this problem by proposing a grammar of temporal graphics, and an associated software implementation, ggtime, that encodes temporal semantics into a declarative grammar for visualizing temporal data. The grammar introduces new composable elements that support visualization across linear, cyclical, quasi-cyclical, and other granularities; standardization of irregular durations; and alignment of time points across different granularities and time zones. It is designed for interoperability with other semantic variables, allowing navigation across the space of visualizations while preserving temporal semantics.

R package: ggtime

Cite
@techreport{ggtime,
  author      = {Cynthia A Huang and Mitchell O'Hara-Wild and Rob J Hyndman and Matthew Kay},
  institution = {Department of Econometrics \& Business Statistics, Monash University},
  title       = {ggtime: A grammar of temporal graphics},
  type        = {Working paper},
  url         = {http://robjhyndman.com/publications/ggtime.html},
  year        = 2025
}