我想使用Matplotlib在Python中繪制Poisson函數。該函數是(exp(-5)* 5 ^ x)/ factorial(x)import numpy as npimport mathimport matplotlib.pyplot as pltt = np.arange(0, 20, 0.1)d = []for i in t: p = pow(5,i) q = p/math.factorial(i) d.append(q)plt.plot( t, np.exp(-5)*d, 'bs')plt.show()但是我遇到了這個錯誤。“只有size ^ 1數組可以轉換為Python標量”。如何繪制該圖?提前致謝
添加回答
舉報
0/150
提交
取消