3 ms·
ggplot2 was inspired by: https://www.amazon.com/Grammar-Graphics-Statistics-Computing/dp/0387245448 https://www.amazon.com/Grammar-Graphics-Statistics-Computing
by perturbation 9y ago
ggplot2 was inspired by:
https://www.amazon.com/Grammar-Graphics-Statistics-Computing/dp/0387245448 https://www.amazon.com/Grammar-Graphics-Statistics-Computing...
and Hadley Wickham wrote about it in http://vita.had.co.nz/papers/layered-grammar.pdf http://vita.had.co.nz/papers/layered-grammar.pdf.
I'm no expert, but I think that one of the main ideas is to separate the elements of making a plot from the way that the data is presented. For example, in ggplot2, you have the data that will go into the graph, the type of plot (or "geometry") that defines how the data are presented (scatterplot, bar plot, etc.), and then various "layers" that can be added that affect style.
In order to split a plot into subplots, you simply define how it is to be faceted (what column should be used to define groups). Grammar-of-graphics moves plotting away from the "turtle graphics" model and lets you specify what should be done. Then ggplot figures out how to do it, kind of like SQL vs. writing for loops to retrieve information.
- Waterluvian 9y agoAha! Thank you. So it's kind of like a declarative way of plotting.