Is *ggplot2: Elegant Graphics for Data Analysis (3e)* a Cookbook for Making Specific Plots?
Updated
No. The book's own introduction states that it is not a cookbook and "won't necessarily help you create any specific graphic that you need." Its primary focus is explaining the Grammar of Graphics that ggplot2 uses and describing the full details of the package. If you need a recipe for one particular chart type, a cookbook or a gallery of examples will serve you better. If you want to understand why ggplot2 works the way it does — so you can tailor any plot to your needs — this is the book's stated purpose.
What the book actually is
According to the site, ggplot2: Elegant Graphics for Data Analysis (3e) is the on-line version of the work-in-progress third edition published by Springer. It is written by Hadley Wickham, Danielle Navarro, and Thomas Lin Pedersen.
The introduction describes its scope in three parts:
- It gives some details on the basics of ggplot2.
- Its primary focus is the Grammar of Graphics that ggplot2 uses.
- It describes the full details of the package.
The stated payoff is understanding the underlying theory, which the authors say gives you "the power to tailor any plot specifically to your needs."
Cookbook vs. this book: how to choose
| Your goal | Cookbook-style resource | This book |
|---|---|---|
| Reproduce a specific chart quickly | Fits well | Not the stated purpose |
| Look up a ready-made recipe | Fits well | Not the stated purpose |
| Understand the Grammar of Graphics | Not the focus | Primary focus |
| Learn the full details of ggplot2 | Partial | Covered |
| Adapt plots to unusual requirements | Limited by recipes | The stated aim |
The distinction is about what kind of help you need. A cookbook answers "how do I make this exact plot?" This book answers "how does this system work, so I can build the plot I need?"
Who should read it
Consider this book if:
- You already have some familiarity with ggplot2 basics and want to go deeper.
- You keep hitting cases where no existing example quite matches what you want.
- You want to understand the theory behind the syntax rather than memorize code.
Look elsewhere first if:
- You are brand new to R and data visualization and need quick wins.
- You have a deadline and one specific graphic to produce.
- You want a reference of chart types rather than an explanation of a system.
A note on the edition
The site describes this as the on-line version of the work-in-progress third edition. The Preface explains what changed from the second edition, so if you have used the 2e material before, that section is the place to check differences. Because it is a work in progress, treat the online text as the current state of that edition rather than a frozen final release.
Bottom line
If your question is "which code makes this one chart?", this book is not designed to answer it. If your question is "how do I think about ggplot2 so I can make whatever chart I need?", that is exactly the ground the book says it covers.