First plots with Matplotlib
One of the strong points of Matplotlib is how quickly we can start producing plots out of the box. Here is our first example:
$ ipython In [1]: import matplotlib.pyplot as plt In [2]: plt.plot([1, 3, 2, 4]) Out[2]: [<matplotlib.lines.Line2D object at 0x2544f10>] In [3]: plt.show()
This code snippet gives the output shown in the following screenshot:

As you can see, we are using IPython. This will be the case throughout the book, so we'll skip the command execution line (and the heading) as you can easily recognize IPython output.
Let's look at each line of the previous code in detail:
In [1]: import matplotlib.pyplot as plt
This is the preferred format to import the main Matplotlib submodule for plotting, pyplot
. It's the best practice and in order to avoid pollution of the global namespace, it's strongly encouraged to never import like:
from <module> import *
The same import style is used in the official documentation, so we want to be consistent with...