Short Praise for Grammar of Graphics

“Once we understand that a pie is a divided bar in polar coordinates, we can construct other polar graphics that are less well known. We will also come to realize why a histogram is not a bar chart…” – Leland Wilkinson, The Grammar of Graphics, Second Edition

“No human should ever write plotting code again, an LLM can do it”

The second quote is from (an unnamed) professor of mine, probably expressing frustration at hard-to-remember syntax for plotting in most languages. Nevertheless, I claim that you should study the logic behind graphs. This logic helps organize what is possible, and the core ideas are fairly brief. This logic—and even some of the syntax from the first implementation (ggplot)—has infected most modern graphic libraries. Take python’s seaborn:

Here is how you should interpret the above:

In short, a composable and unfussy bag-of-tricks to display medium-dimensional data1 on a 2D canvas. A few more modern ideas to extend this framework:

Mathematica (rest in peace) was wonderful at this. You could wrap nearly anything in Manipulate and get an interactive graphic with a “Play” button.

The power of this framework is not the originality of its design but the expressive depth of its few rules. Viewing 4 to 7 dimensions of your dataset in a single image from ~5 lines of code should be taken for granted by more people.

Footnotes:

1

also known as “Grande data” in the Starbucks Ontology of Data Size™