0

My Code ain’t working here, Guys please help.?

import numpy as np from matplotlib import pyplot as plt x = np.linspace(-2, 2, 100) y1 = np.cos(np.pi * x) y2 = np.sin(np.pi * x) plt.plot(x, y1, 'go') plt.plot(x, y2, 'r-') plt.xlabel('xlabel') plt.ylabel('ylabel') plt.grid(alpha=0.4) plt.title('Kelvin Diagram') plt.show()

22nd Jan 2022, 10:32 AM
Kelvin  Sintim 
Kelvin  Sintim  - avatar
2 Antworten
+ 3
Add plt.savefig("plot.png") after plt.show()
22nd Jan 2022, 10:56 AM
Lisa
Lisa - avatar
0
Thanks bro
22nd Jan 2022, 1:20 PM
Kelvin  Sintim 
Kelvin  Sintim  - avatar