这是我在Enthought Canopy中编写的用于调整轴的代码:
import numpy as np
import matplotlib.pyplot as plt
from scipy.stats import norm
x = np.arange(-3,3,0.001)
axe = plt.axes()
axe.set_xlim([-5, 5])
axe.set_ylim([0, 1.0])
axe.set_xticks([-5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5])
axe.set_yticks([0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0])
plt.plot(x, norm.pdf(x))
plt.plot(x, norm.pdf(x, 1.0, 0.5))
plt.show()
我收到以下错误:
%run "c:\users\tejpal\appdata\local\temp\tmppdy2am.py"
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
c:\users\tejpal\appdata\local\temp\tmppdy2am.py in <module>()
5 x = np.arange(-3,3,0.001)
6 axe = plt.axes()
----> 7 axe.set_xlim([-5, 5])
8 axe.set_ylim([0, 1.0])
9 axe.set_xticks([-5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5])
TypeError: 'list' object is not callable
请帮助我!