import numpy as np px = np.linspace(55,110) dx = 3.777178e6*px**(-2.154) profit = (px-50)*dx import matplotlib.pyplot as plt plt.figure(figsize=(6,4)) plt.subplot(2,1,1) plt.plot(px,dx,label='Demand') plt.plot(price,d.value[0],'o',markersize=10,color='orange') plt.grid(); plt.ylabel('Demand'); plt.legend() plt.subplot(2,1,2) plt.plot(px,profit,label='Profit') plt.plot(price,obj,'o',markersize=10,color='orange') plt.grid(); plt.legend() plt.xlabel('Price'); plt.ylabel('Profit') plt.tight_layout(); plt.savefig('results.png',dpi=300) plt.show()