You can use the graph function of certain axes:
import matplotlib.pyplot as plt from scipy import sin, cos f, ax = plt.subplots(2,1) x = [1,2,3,4,5,6,7,8,9] y1 = sin(x) y2 = cos(x) plt.sca(ax[0]) plt.plot(x,y1) plt.sca(ax[1]) plt.plot(x,y2) plt.show()
This should appear in two different subheadings.
Harpe source share