10cggSQL

Database Management

Mick McQuaid

University of Texas at Austin

11 May 2026

The Grammar of Graphics

  • Twenty-five years ago, Leland Wilkinson published an approach to graphics called The Grammar of Graphics in a book of the same name: Wilkinson (2005)
  • Soon after, Hadley Wickham created a software package called ggplot that extended the grammar of graphics with layers, described in Wickham (2010)
  • The R package ggplot2 has become the dominant avenue for publishing statistical graphics in the ensuing years
  • The company behind it recently released alpha software called ggSQL

ggSQL

The idea of ggSQL is to allow a person to use SQL-like queries to produce layered statistical graphics. The next frame shows an example

VISUALISE bill_len AS x, bill_dep AS y, species AS fill FROM ggsql:penguins
DRAW point
SCALE x 
  RENAMING * => '{} mm'
LABEL
  title => 'Relationship between bill dimensions in 3 species of penguins',
  x => 'Bill length',
  y => 'Bill depth'

Wrap-up

  • You can learn more at https://ggsql.org/ where you can try it out in the browser before you install it
  • I’m using it with Quarto (the package that generates these slides) so I do a further installation you can find in the table of contents on the above page

END

References

Wickham, Hadley. 2010. “A Layered Grammar of Graphics.” Journal of Computational and Graphical Statistics 19 (1): 3–28. https://doi.org/10.1198/jcgs.2009.07098.
Wilkinson, Leland. 2005. The Grammar of Graphics (Statistics and Computing). Springer-Verlag.

Colophon

This slideshow was produced using quarto

Fonts are Roboto, Roboto Light, and Victor Mono Nerd Font