Chapter 9. Plotting with matplotlib

matplotlib is a very useful Python plotting library. It integrates nicely with NumPy but is a separate open source project. You can find a gallery of beautiful examples at http://matplotlib.org/gallery.html.

matplotlib also has utility functions to download and manipulate data from Yahoo Finance. We will see several examples of stock charts.

This chapter features extended coverage of the following topics:

  • Simple plots
  • Subplots
  • Histograms
  • Plot customization
  • Three-dimensional plots
  • Contour plots
  • Animation
  • Logplots

Simple plots

The matplotlib.pyplot package contains functionality for simple plots. It is important to remember that each subsequent function call changes the state of the current plot. Eventually, we will ...

Get NumPy : Beginner's Guide - Third 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.