发布时间:2019-09-07 08:06:06编辑:auto阅读(2831)
1、用python画出log1.5(x),log(2x),log(3x)
import numpy as np
import math
import matplotlib.pyplot as plt
x=np.arange(0.05,3,0.05)
y1=[math.log(a,1.5)for a in x]
y2=[math.log(a,2)for a in x]
y3=[math.log(a,3)for a in x]
plot1=plt.plot(x,y1,'-g',label="log1.5(x)")
plot2=plt.plot(x,y2,'-r',label="log2(x)")
plot3=plt.plot(x,y3,'-b',label="log3(x)")
plt.legend(loc='lower right')
plt.show()
2、输出结果
上一篇: Python的io模块详解
下一篇: 用python记录运行pid,并在需要时
47863
46424
37314
34759
29332
25990
24945
19967
19563
18050
5806°
6433°
5946°
5975°
7079°
5925°
5963°
6456°
6417°
7798°