Skip to content
Python and Data Primer / Scientific Python

Matplotlib

A price chart should make a stated feature of the data easy to inspect. Matplotlib lets you draw that chart, label its units and save it from code. This lesson plots a small pandas series and explains how scale and data selection affect its interpretation. Check the time index before drawing conclusions from the chart.
Learning objectives. By the end of this note you should be able to:
  • create a figure and axes;
  • add labelled data, title and units;
  • save the result deterministically;
  • identify a misleading plotting choice.

In this lesson

  1. Build the chart explicitly
  2. Plot the quantity the question asks about
  3. Keep the observed chart points visible

Before you start

The full lesson, with worked examples and exercise solutions, is for members.

Read the full lesson

New to SelfMadeQuant.com? See membership options or browse the Python and Data Primer syllabus.