import numpy as np import matplotlib.pyplot as plt x = np.array([0, 1, 2, 3, 4, 5]) y = x z = np.sqrt(x) plt.close('all') plt.figure(1, figsize=(12, 9)) plt.subplot(2, 1, 1) plt.plot(x, y, 'r*-') plt.xlabel('x [s]') plt.ylabel('[m]') plt.grid() plt.legend(('y',)) plt.subplot(2, 1, 2) plt.plot(x, z, 'bo-') plt.xlabel('x [s]') plt.ylabel('[m]') plt.grid() plt.legend(('z',)) plt.savefig('plott2.pdf') plt.show()