Chapter 8. Data Visualization
Use a picture. It’s worth a thousand words.
Arthur Brisbane (1911)
Data visualization turns numerical results into shapes you can scan quickly: trends, outliers, and regime changes often become obvious in a plot long before they appear in a table. This chapter introduces Matplotlib for static plots that you can save as high-quality Portable Network Graphics (PNG) images and include in reports, notebooks, and this book.
The chapter shows how to use Matplotlib to create line plots, scatter plots, histograms, and multi-panel figures from NumPy and pandas data. It shows how to work with the Figure/Axes application programming interface (API), control titles, labels, grids, and legends, standardize style choices, save figures to disk, and relate the snippets shown in the chapter to the book’s figure-generation scripts in code/figures/.
To follow along, you need a working python environment with numpy, pandas, and
matplotlib installed, plus basic familiarity with ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access