In [ ]:
%pylab notebook
import matplotlib.pyplot as plt

In [ ]:
# Note that this cell produces an output that is
# [<matplotlib.lines.Line2D at 0x110376650>]
# which is a list of 1 Line2D lines object
plt.plot([1,8,5,6])

In [ ]:
# So that lines object can be captured like this:
l, = plt.plot([8, 1, 5, 2])

In [ ]:
plt.show()

In [ ]:
# And this command will change the line color on-the-fly:
l.set_color('magenta')

In [ ]: