Matplotlib is a Python-based 2D plotting library. It works well with Python, and even better with IPython. It includes the pyplot
module, which provides MATLAB-like functionality. Matplotlib functionality can be accessed both programmatically and interactively, from the IPython command line. The examples in this section will be run from the command line for ease of explication.
Matplotlib should be installed along with most major IPython distributions. If yours does not include it, standard package installation procedures (for example, pip install
or sudo apt-get
) should suffice.
There are two ways to start up matplotlib: matplotlib-only
or pylab
.
The difference is that using matplotlib-only
mode activates matplotlib
interactive support but does not import anything into the namespace. pylab
mode executes more imports and changes the namespace.
Once installed, matplotlib-only
mode can be started either from the command line or by using the %matplotlib
magic, as shown...