Don't use pylab, it just imports a bunch of junk into the namespace. It was originally intended to provide an environment familiar to people coming from MATLAB.
Instead, use:
import matplotlib.pyplot as plt
Note that pylab's doc itself recommends not to use it:
>>> print(pylab.__doc__)
.. warning::
Since heavily importing into the global namespace may result in unexpected
behavior, the use of pylab is strongly discouraged. Use `matplotlib.pyplot`
instead.
`pylab` is a module that includes `matplotlib.pyplot`, `numpy`, `numpy.fft`,
`numpy.linalg`, `numpy.random`, and some additional functions, all within
a single namespace. Its original purpose was to mimic a MATLAB-like way
of working by importing all functions into the global namespace. This is
considered bad style nowadays.