python计算平均函数(python输出sinand)

python计算平均函数(python输出sinand)(1)

sin and cos函数曲线

import numpy as np

import math

import matplotlib.pyplot as plt

#sin and cos curves

x=np.arange(0,6,0.1)

y1=np.sin(x)

y2=np.cos(x)

plt.plot(x,y1,label='sin')

plt.plot(x,y2,label='cos',linestyle='--')

plt.xlabel('x')

plt.ylabel('y')

plt.title('sin & cos') #print title

plt.legend() #print curve style

plt.show()

,

免责声明:本文仅代表文章作者的个人观点,与本站无关。其原创性、真实性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容文字的真实性、完整性和原创性本站不作任何保证或承诺,请读者仅作参考,并自行核实相关内容。文章投诉邮箱:anhduc.ph@yahoo.com

    分享
    投诉
    首页