Use plt.savefig instead of plt.show