“A grammar of graphics is a tool that enables us to concisely describe the components of a graphic. Such a grammar allows us to move beyond named graphics (e.g., the “scatterplot”) and gain insight into the deep structure that underlies statistical graphics."
We are used to describing graphics with simple labels – a scatterplot, a line chart, a map, and so on. But that belies the details that go into that graphic’s construction. The ggplot2
package has been built with an eye on capturing all the layers that build up to the final graphic. The underlying philsoophy can perhaps be captured most simply as follows.