Matplotlib 3.0 Cookbook
上QQ阅读APP看书,第一时间看更新

Getting ready

Once you have copied basic_units.py into your working directory, you can start using all the functions available there.

Import the required libraries. Here, we are introducing two other features of Matplotlib, lines, which has objects for drawing lines, and text, which is used to annotate objects on the chart:

import matplotlib.lines as lines
import matplotlib.text as text
from basic_units import cm, inch
import matplotlib.pyplot as plt