[英]Seaborn FactorPlot throws TypeError
sns.FactorPlot嘗試設置set_title時將拋出TypeError錯誤。 這發生在示例數據幀上,但是更令人擔憂的是,也發生在文檔中的示例上。
所以
import seaborn as sns
exercise = sns.load_dataset('exercise')
sns.factorplot("kind", "pulse", "diet", exercise, kind="point")
返回長回溯。 結束了:
*/lib/python2.7/site-packages/seaborn/linearmodels.pyc in plot(self, ax)
275 if hasattr(self.hue, "name"):
276 leg.set_title(self.hue.name,
--> 277 prop={"size": mpl.rcParams["axes.labelsize"]})
278 ax.xaxis.grid(False)
279 ax.set_xticks(self.positions)
TypeError: set_title() got an unexpected keyword argument 'prop'
當我在啟用pylab inline的iPython Notebook中運行此腳本時,該圖在回溯下顯示良好。 但我不明白為什么會收到此錯誤,尤其是文檔中的示例。
這個錯誤發生在seaborn 0.3.1和matplotlib <1.2上,但是可以通過更新matplotlib或seaborn來修復(當前這意味着從github安裝seaborn的開發版本)。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.