画一条sinx曲线 # draw the sinx curve import numpy as np import matplotlib.pyplot as plt x = np.linspace(-20, 20, 100) y = np.sin(x) plt.plot(x, y) plt.show()
cos x 也来一条 # draw the cos x curve import numpy as np import matplotlib.pyplot as plt x = np.linspace(-20, 20, 100) y = np.cos(x) plt.plot(x, y) plt.show()