import matplotlib.pyplot as plt import numpy as np f = plt.figure(figsize=(10,3)) ax = f.add_subplot(121) ax2 = f.add_subplot(122) x = np.linspace(0,4,1000) ax.plot(x, np.sin(x)) ax2.plot(x, np.cos(x), 'r:')