from matplotlib import pyplot as PLT
%matplotlib inline
import numpy as np
fig = PLT.figure(figsize=(12,9))
# sub1 = fig.add_subplot(221) # equivalent to: plt.subplot(2, 2, 1) (nrow, ncol, plot_no)
ax1 = fig.add_subplot(2,2,1)
ax1.plot([(1, 2), (3, 4)], [(4, 3), (2, 3)])
ax2 = fig.add_subplot(2,2,4)
ax2.plot([(7, 2), (5, 3)], [(1, 6), (9, 5)])
PLT.show()
PLT.figure(figsize=(12,9))
for i in range(19):
PLT.subplot(5,4,i+1)
fig, axes = PLT.subplots(nrows=2, ncols=3, sharex=True, sharey=True)
#print(fig, axes)
axes[1,1].plot([1,2,3,4], [2,3,4,5], color='red')
axes[1,2].plot([1,2,3,4], np.sin([1,2,3,4]), color='red')
[<matplotlib.lines.Line2D at 0x873edd8>]