Python小游戏 | 05-三角函数绘制

一、程序如下:

import numpy as np
import matplotlib.pyplot as plt
x = np.linspace(0, 6, 100)
y = np.cos(2 * np.pi * x) * np.exp(-x) + 0.8
plt.plot(x, y, 'k', color='r', linewidth=3, linestyle='-')
plt.show()

二、执行效果:

猜你喜欢

转载自blog.csdn.net/Neutionwei/article/details/108311056