Matplotlib Subplot second y-axis example

  Uncategorized
A good example for subplot second y-axis:

from numpy.random import rand
import matplotlib
import matplotlib.pyplot as plt

ax0 = plt.subplot(211)
ax1 = ax0.twinx()
ax0.plot(rand(1) * rand(10),'r')
ax1.plot(10*rand(1) * rand(10),'b')
plt.show()
based on the reference