import numpy as np import matplotlib.pyplot as plt v = np.linspace(0, 20, 40) c = np.cos(v) s = np.sin(v) plt.close('all') plt.figure(1, figsize=(12, 9)) plt.subplot(2, 1, 1) plt.plot(v, c, 'r*-', label='c = cos(v)') plt.legend() plt.grid() plt.xlabel('v [rad]') plt.subplot(2, 1, 2) plt.plot(v, s, 'bo-', label='s = sin(v)') plt.legend() plt.grid() plt.xlabel('v [rad]') plt.savefig('subplott.pdf') plt.show()