正如標題已經說明我得到一個TypeError
調用下面的方法時:餡餅()得到了一個意想不到的關鍵字參數「由startAngle」
plt.pie(ylist, labels=xlist, autopct='%1.1f%%', startangle=90, counterclock=False)
>>> TypeError: pie() got an unexpected keyword argument 'startangle'
當我離開了startangle
我得到一個TypeError
爲counterclock
:
plt.pie(ylist, labels=xlist, autopct='%1.1f%%', counterclock=False)
>>> TypeError: pie() got an unexpected keyword argument 'counterclock'
當我也離開counterclock
它工作正常,我得到所需的情節。
但是根據documentation這兩個關鍵字實際存在的,我也檢查了我的python-matplotlib庫的版本,以達到最新的(這是不可能的,該模塊matplotlib.pyplot是OUT- date matplotlib是最新的,是嗎?)。順便說一句,我使用Python 2.7.3。
有人可以解釋這個錯誤嗎?
它是什麼版本,具體是什麼? – 2014-09-03 19:57:54
使用'dpkg -s python-matplotlib | grep'Version'我得到輸出'Version:1.1.1〜rc1 + git20120423-0ubuntu1'。 – 2014-09-03 20:09:13
1.1.1甚至沒有接近最新的。截至目前的最新版本是[1.4.0](http://matplotlib.org/contents.html)。 – 2014-09-03 20:12:04