Praise for Fundamentals of Data Visualization
Wilke has written the rare data visualization book that will help you move beyond the standard line, bar, and pie charts that you know and use. He takes you through the conceptual underpinnings of what makes an effective visualization and through a library of different graphs that anyone can utilize. This book will quickly become a go-to reference for anyone working with and visualizing data.
Jonathan Schwabish, Senior Fellow, Urban Institute
In this well-illustrated view of what it means to clearly visualize data, Claus Wilke explains his rationale for why some graphs are effective and others are not. This incredibly useful guide provides clear examples that beginners can emulate as well as explanations for stylistic choices so experts can learn what to modify.
Steve Haroz, Research Scientist, Inria
Wilkes book is the best practical guide to visualization for anyone with a scientific disposition. This clear and accessible book is going to live at arms reach on lab tables everywhere .
Scott Murray, Lead Program Manager, OReilly Media
Fundamentals of Data Visualization
by Claus O. Wilke
Copyright 2019 Claus O. Wilke. All rights reserved.
Printed in the United States of America.
Published by OReilly Media, Inc. , 1005 Gravenstein Highway North, Sebastopol, CA 95472.
OReilly books may be purchased for educational, business, or sales promotional use. Online editions are also available for most titles (http://oreilly.com). For more information, contact our corporate/institutional sales department: 800-998-9938 or corporate@oreilly.com .
- Editors: Mike Loukides and
Melissa Potter - Production Editor: Kristen Brown
- Copyeditor: Rachel Head
- Proofreader: James Fraleigh
- Indexer: Ellen Troutman-Zaig
- Interior Designer: David Futato
- Cover Designer: Karen Montgomery
- Illustrator: Claus Wilke
- March 2019: First Edition
Revision History for the First Edition
- 2019-03-15: First Release
See http://oreilly.com/catalog/errata.csp?isbn=9781492031086 for release details.
The OReilly logo is a registered trademark of OReilly Media, Inc. Fundamentals of Data Visualization, the cover image, and related trade dress are trademarks of OReilly Media, Inc.
The views expressed in this work are those of the author, and do not represent the publishers views. While the publisher and the author have used good faith efforts to ensure that the information and instructions contained in this work are accurate, the publisher and the author disclaim all responsibility for errors or omissions, including without limitation responsibility for damages resulting from the use of or reliance on this work. Use of the information and instructions contained in this work is at your own risk. If any code samples or other technology this work contains or describes is subject to open source licenses or the intellectual property rights of others, it is your responsibility to ensure that your use thereof complies with such licenses and/or rights.
978-1-492-03108-6
[GP]
Preface
If you are a scientist, an analyst, a consultant, or anybody else whohas to prepare technical documents or reports, one of the most importantskills you need to have is the ability to make compelling datavisualizations, generally in the form of figures. Figures will typicallycarry the weight of your arguments. They need to be clear, attractive,and convincing. The difference between good and bad figures can be thedifference between a highly influential or an obscure paper, a grant orcontract won or lost, a job interview gone well or poorly. And yet,there are surprisingly few resources to teach you how to make compellingdata visualizations. Few colleges offer courses on this topic, and thereare not that many books on this topic either. (Some exist, of course.)Tutorials for plotting software typically focus on how to achievespecific visual effects rather than explaining why certain choices arepreferred and others not. In your day-to-day work, you are simplyexpected to know how to make good figures, and if youre lucky you havea patient adviser who teaches you a few tricks as youre writing yourfirst scientific papers.
In the context of writing, experienced editors talk about ear, theability to hear (internally, as you read a piece of prose) whether thewriting is any good. I think that when it comes to figures and othervisualizations, we similarly need eye, the ability to look at a figureand see whether it is balanced, clear, and compelling. And just as isthe case with writing, the ability to see whether a figure works or notcan be learned. Having eye means primarily that you are aware of alarger collection of simple rules and principles of good visualization,and that you pay attention to little details that other people mightnot.
In my experience, again just as in writing, you dont develop eye byreading a book over the weekend. It is a lifelong process, and conceptsthat are too complex or too subtle for you today may make much moresense five years from now. I can say for myself that I continue toevolve in my understanding of figure preparation. I routinely try toexpose myself to new approaches, and I pay attention to the visual anddesign choices others make in their figures. Im also open to changing mymind. I might today consider a given figure great, but next month Imight find a reason to criticize it. So with this in mind, please donttake anything I say as gospel. Think critically about my reasoning forcertain choices and decide whether you want to adopt them or not.
While the materials in this book are presented in a logical progression,most chapters can stand on their own, and there is no need to read thebook cover to cover. Feel free to skip around, to pick out a specificsection that youre interested in at the moment, or one that covers aparticular design choice youre pondering. In fact, I think you will getthe most out of this book if you dont read it all at once, but ratherread it piecemeal over longer stretches of time, try to apply just a fewconcepts from the book in your figuremaking, and come back to read aboutother concepts or reread sections on concepts you learned about a while back. Youmay find that the same chapter tells you different things if you rereadit after a few months have passed.
Even though nearly all of the figures in this book were made with R andggplot2, I do not see this as an R book. I am talking about generalprinciples of figure preparation. The software used to make the figuresis incidental. You can use any plotting software you want to generatethe kinds of figures Im showing here. However, ggplot2 and similarpackages make many of the techniques Im using much simpler than otherplotting libraries. Importantly, because this is not an R book, I do notdiscuss code or programming techniques anywhere in this book. I want youto focus on the concepts and the figures, not on the code. If you arecurious about how any of the figures were made, you can check out the bookssource code at its GitHub repository.
Thoughts on Graphing Software and Figure-Preparation Pipelines
I have over two decades of experience preparing figures for scientificpublications and have made thousands of figures. If there has been oneconstant over these two decades, its been the change in figure preparationpipelines. Every few years, a new plotting library is developed or a newparadigm arises, and large groups of scientists switch over to the hotnew toolkit. I have made figures using gnuplot, Xfig, Mathematica,Matlab, matplotlib in Python, base R, ggplot2 in R, and possibly othersI cant currently remember. My current preferred approach is ggplot2 inR, but I dont expect that Ill continue using it until I retire.