python 绘制三角函数图形 sin、con、arcsin、arccos | 您所在的位置:网站首页 › y=arccos的图像怎么画 › python 绘制三角函数图形 sin、con、arcsin、arccos |
1、正弦和余弦的图形 import numpy as np from matplotlib import pyplot as plt %matplotlib notebook x = np.linspace((-np.pi)*2, np.pi*2, 50, endpoint=True) y1, y2 = np.sin(x), np.cos(x) plt.plot(x, y1, c='g', marker='s', label='sin(x)') plt.plot(x, y2, c='r', marker='o', label='con(x)') plt.legend(loc='upper left', numpoints=2,)
2、反正弦和反余弦的图形 import numpy as np from matplotlib import pyplot as plt %matplotlib notebook x = np.linspace(-4, 4, 100) y1, y2 = np.arcsin(x), np.arccos(x) plt.plot(x, y1, c='b', marker='s', label='arcsin(x)') plt.plot(x, y2, c='r', marker='o', label='arccon(x)') plt.legend(loc='upper right', numpoints=2,) plt.ylim(-4, 4) |
CopyRight 2018-2019 实验室设备网 版权所有 |