Preface
This book began with a chart that nobody read. It was a dashboard I built for a regional agency. Every number in it was correct. It sat on a shared drive while the decision it was meant to inform was made from a spreadsheet. The chart answered a question that nobody in the room had asked. It also took longer to read than the table it replaced.
I have taught data visualization to graduate students in business and analytics for many years. The part of the work I still enjoy is the moment a student sees something in a chart. It might be the cluster of points in a scatter plot that does not belong with the rest. It might be a pattern that appears in eleven panels of small multiples and not in the twelfth. Some students reach this moment in the second week, and others do not reach it during the course. This book is an attempt to help more students reach it, and to help readers who never took the course.
What a Chart Should Do
A chart should let a reader answer a question faster or more accurately than they could from the numbers alone. Every chapter in this book tests its charts against that standard. Chapter 1 shows what a picture can do that a table cannot, and what it can leave out. Chapter 2 explains how we see a chart, and where the visual system can be misled. Chapter 3 gives seven questions to ask of any chart someone else made. It works through them on a chart that was widely shared online.
Chapters 4 through 8 are the main part of the book. Each takes one question a chart can answer: comparison, distribution, relationship, change over time, and place. Each draws the same data several ways. The aim is that you choose a chart from the question. A reader who knows why a dumbbell chart suits one question and a grouped bar chart suits another does not need a catalog of chart types.
Chapters 9 and 10 are about craft. Chapter 9 takes one chart from a software default to a finished figure, through color, type, and annotation. Chapter 10 is about uncertainty. A chart that shows its uncertainty is more complete than one that leaves it out. Chapter 10 reviews evidence that readers also trust it more. Chapters 11 and 12 are about telling. Chapter 11 says which interactions to add to a chart, and builds a dashboard with three. Chapter 12 goes from a first exploratory chart to a three-panel story. It ends with a method for using a language model without letting it decide what the finding is.
The Cases
The data in this book are about people. They cover child mortality, air pollution, asylum, rural school districts, college graduates, jail and prison populations, county poverty, election polls, and life expectancy in the United States and its peers. I chose these cases for two reasons. The first is that readers treat a chart about something that matters differently from a chart about car weights or iris petals. The second is that a design choice such as a truncated axis has consequences when the chart is about jail populations rather than about car weights.
Every dataset is public, and every figure caption names its source. The data files, the scripts that built them, and the code behind every figure are on the companion site. Nothing in the book is simulated unless the text says so.
AI, Throughout
A language model will now draw a chart on request. More charts are now made this way than most readers have been trained to check. That makes the skills in this book more useful. A model handles the syntax of a chart well. It is less reliable on whether the chart is accurate, and it does not know what the reader needs. Each chapter ends with an AI Reality Check. It shows what a model tends to do with that chapter’s problem and what a reader with the chapter’s skills would catch. Chapter 12 combines the checks into a method you can follow.
Who the Book Is For
The book is written for analysts who make charts, managers who read them, and students in a course on either. It can support a graduate or upper-level undergraduate course, and it can be read on its own. The code is in R and ggplot2. In the online edition, the code is under a fold, so a reader who wants only the figures can skip it. A reader who wants the code can open any fold and run it. The print edition leaves the code out. The free companion Run the Numbers teaches the R this book uses, from installing it to reading code a model wrote.
Thanks
My students taught me where an explanation works and where it fails. The community partners across the Inland Northwest who let me build dashboards for their work taught me what a chart has to do to be used. The researchers, journalists, and designers named in the Further Reading of each chapter taught me most of what is here.
Most of all, I thank my family. My wife, Anvita, puts up with a husband who points out axis labels in the wild. My daughters, Aashi and Avisha, remind me that the audience for any chart is a person trying to understand something.
Vivek H. Patil
Spokane, Washington
How to Use This Book
Each chapter has the same structure. It opens with a case and builds the chapter’s charts step by step from one dataset. Ethics Moment boxes discuss a design choice that involves a judgment. Try It Online boxes link to a browser app where you can change the choice and see the chart change. An AI Reality Check box comes at the end of each chapter’s main text. Putting It All Together restates the chapter’s rules. Looking Ahead points to the next chapter. Further Reading is annotated, and Key Terms collects the bolded terms. Exercises come in three tiers.
- Check Your Understanding asks concept questions that need no code.
- Apply It asks you to build or rebuild a chart from the chapter’s data.
- Think Deeper asks questions of judgment and ethics with no single right answer.
The code is optional. In the online edition, every figure has a “Show the code” fold beneath it. Open it to see how the figure was made, copy it, and change it. The data files load from the companion site, so the code runs as written. The book does not teach R. Run the Numbers does, and a reader new to R can read the two together.
The apps run in the browser. Each Try It Online box links to an app that needs no installation and no account. The apps are listed on the Apps and Data page at the end of the book.
Cross-references matter. Later chapters depend on earlier ones. Chapter 9’s rules for color depend on Chapter 2’s account of how readers see color. Chapter 12 uses rules from every chapter before it.