How to do it...

The following code block draws three plots in one figure:

  1. Define the figure and its layout with three axes:
fig = plt.figure()
ax1 = plt.subplot(221)
ax2 = plt.subplot(222)
ax3 = plt.subplot(212)
  1. Plot the line graphs on each of the axes:
ax1.plot([1,2])
ax2.plot([2,1])
ax3.plot([2,4])
  1. Display the plot on the screen:
plt.show()