Я скопировал следующее из онлайн-документации matplotlib :
Код: Выделить всё
mu, sigma = 100, 15
x = mu + sigma * np.random.randn(10000)
# the histogram of the data
n, bins, patches = plt.hist(x, 50, normed=1, facecolor='g', alpha=0.75)
plt.xlabel('Smarts')
plt.ylabel('Probability')
plt.title('Histogram of IQ')
plt.text(60, .025, r'$\mu=100,\ \sigma=15$')
plt.axis([40, 160, 0, 0.03])
plt.grid(True)
plt.show()
Код: Выделить всё
TypeError Traceback (most recent call last)
in ()
8 plt.xlabel('Smarts')
9 plt.ylabel('Probability')
---> 10 plt.title('Histogram of IQ')
11 plt.text(60, .025, r'$\mu=100,\ \sigma=15$')
12 plt.axis([40, 160, 0, 0.03])
TypeError: 'str' object is not callable
Код: Выделить всё
pyplot.suptitle()
Я использую Python 2.7.5 и последнюю версию matplotlib на iMac с процессором I7 OSX 10.8, 8 ГБ оперативной памяти и ipython блокнот.
Кто-нибудь знает, что происходит?
Подробнее здесь: https://stackoverflow.com/questions/194 ... urns-error