1 def auto_correlate(x):
2 cor = np.correlate(x,x,mode="full")
3 return cor[N-1:]
4 c = np.zeros(N)
5 c = auto_correlate(x-ave)/N
6 plt.plot(c)
7 plt.xlim(-1000, 10000)
8 plt.xlabel(r'$i$',fontsize=16)
9 plt.ylabel(r'$\varphi(i)$',fontsize=16)
10 print('\sigma^2 = ', std**2)
11 plt.show()
为什么我不断收到错误 'tuple' object not callable online 7 ?请解释
最佳答案
看起来您可能已经覆盖了 plt.xlim 函数。
你有没有跑过plt.xlim=(-1000, 10000)
? (注意“=”)
类型 plt.xlim
并运行它来检查。
输出应该是这样的:
<function matplotlib.pyplot.xlim(*args, **kwargs)>
关于python-3.x - “元组”对象不是使用 matplotlib 库的可调用错误?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47946517/