y1 = np.cumsum(np.random.random(time.size) - 0.5)
y2 = np.cumsum(np.random.random(time.size) - 0.5)
y2 = y2 * 20 + 10
fig = plt.figure()
host = fig.add_subplot(111)
par = host.twinx()
host.set_ylabel('One Thing')
par.set_ylabel('Another')
line1, = host.plot(time, y1)
line2, = par.plot(time, y2, 'go')
host.legend([line1, line2], ['Item 1', 'Item 2'])
host.xaxis_date()
plt.show()
graphing multiple types of plots (line, scatter, bar etc) in the same window