%pylab inline from matplotlib import rcParams print rcParams['backend'] x = np.linspace(0, 10, 1000) plt.plot(x, np.sin(x)) matplotlib.rcParams['figure.facecolor'] = 'w' x = np.linspace(0, 10, 1000) plt.plot(x, np.sin(x)) import pylab # note that this import is automatic in `%pylab` or `%pylab inline` mode pylab.figure() # this is optional: if you just call plot(), a figure will be created pylab.plot(x, np.sin(x)) pylab.title('plot 1: sine') pylab.figure() pylab.plot(x, np.cos(x)) pylab.title('plot 2: cosine') import matplotlib.pyplot as plt # Again, in pylab mode this import happens automatically fig1 = plt.figure() ax1 = fig1.add_subplot(1, 1, 1) ax1.plot(x, np.sin(x)) ax1.set_title('sine') fig2 = plt.figure() ax2 = fig2.add_subplot(1, 1, 1) ax2.plot(x, np.cos(x)) ax2.set_title('cosine') fig1 = plt.figure() fig2 = plt.figure() ax1 = fig1.add_subplot(1, 1, 1) ax2 = fig2.add_subplot(1, 1, 1) ax1.plot(x, np.sin(x)) ax2.plot(x, np.cos(x)) ax1.set_title('sine') ax2.set_title('cosine') %pylab x = np.linspace(0, 10, 1000) fig, ax = plt.subplots() lines = ax.plot(x, np.sin(x)) print lines lines[0].set_color('green') fig.canvas.draw() lines[0].set_linewidth(3) fig.canvas.draw() txt = plt.text(4, 0.5, "Hello") txt.set_size(20) txt.set_color('blue') fig.canvas.draw() txt.set_x(7) txt.set_y(-0.5) fig.canvas.draw() lines[0].set_ydata(np.sin(2 * x)) fig.canvas.draw() for i in range(100): lines[0].set_ydata(np.sin(x + 0.1 * i)) fig.canvas.draw() txt.set_