Winston Chang’s practical guide collects more than 150 recipes for making high-quality graphs in R without having to master every detail of R’s graphics systems first. Each recipe states a concrete problem, gives a solution you can adapt to your own data, and then explains how and why the solution works.

This second edition is built largely around the updated ggplot2 package and adds more material on the visual design of graphics. It is aimed at scientists, engineers, programmers, and data analysts who already know some R. You can look up a specific task when you need it, or simply browse for ideas about what kinds of plots are possible. An appendix explains the ideas behind ggplot2, including its terminology, stats, and themes.

The recipes cover a wide range of tasks, including how to:

  • Explore data quickly with scatter plots, line graphs, bar graphs, histograms, and box plots
  • Build and customize bar graphs, line graphs, and scatter plots
  • Summarize distributions with histograms, density curves, violin plots, and dot plots
  • Add annotations, error bars, and mathematical expressions to help readers interpret a plot
  • Control axes, legends, facets, themes, and overall appearance
  • Choose color palettes, including colorblind-friendly options
  • Create network graphs, heat maps, maps, and 3D scatter plots
  • Export graphics to PDF, SVG, and bitmap formats, and reshape data with tidyverse tools

The second edition is free to read online at the book’s website.