pylab#
pylab is a historic interface and its use is strongly discouraged. The equivalentreplacement ismatplotlib.pyplot. SeeMatplotlib Application Interfaces (APIs) for a full overviewof Matplotlib interfaces.
pylab was designed to support a MATLAB-like way of working with all plotting relatedfunctions directly available in the global namespace. This was achieved through awildcard import (frompylabimport*).
Warning
The use ofpylab is discouraged for the following reasons:
frompylabimport* imports all the functions frommatplotlib.pyplot,numpy,numpy.fft,numpy.linalg, andnumpy.random, and some additional functions intothe global namespace.
Such a pattern is considered bad practice in modern python, as it clutters the globalnamespace. Even more severely, in the case ofpylab, this will overwrite somebuiltin functions (e.g. the builtinsum will be replaced bynumpy.sum), whichcan lead to unexpected behavior.