Non interactive:

import matplotlib.pyplot as plt
import numpy as np
plt.plot(....)

Embedded matplotlib in a gui. pylab is a way of importing pyplot and most of numpy into the namespace.

This is equivalent to from pylab import *. Note that it imports numpy as np and pyplot as plt.

ipython --pylab

http://lwn.net/Articles/631475/