Chapter 3. Drawing Your First Plots and Customizing Them

In this chapter, we will go into a lot more detail and present most of the possibilities of matplotlib. We will cover the following points:

  • Defining plot types – bar, line, and stacked charts
  • Drawing simple sine and cosine plots
  • Defining axis lengths and limits
  • Defining plot line styles, properties, and format strings
  • Setting ticks, labels, and grids
  • Adding legends and annotations
  • Moving spines to the center
  • Making histograms
  • Making bar charts with error bars
  • Making pie charts count
  • Plotting with filled areas
  • Making stacked plots
  • Drawing scatter plots with colored markers

Introduction

Although we have already drawn our first plots using matplotlib, we didn't go into the details about how they work, how ...

Get Python Data Visualization Cookbook - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.