当sns.FactorPlot试图使用set_title时,它给我扔了一个set_title。这种情况发生在示例dataframe上,但更令人担忧的是,文档中的示例也会发生这种情况。
所以
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内联的iPython笔记本中运行这一功能时,绘图在回溯下面显示得很好。但是我不明白为什么我会得到这个错误,尤其是文档中的一个例子。
发布于 2014-08-12 20:05:27
此错误发生在seABON0.3.1和matplotlib < 1.2,但可以通过更新matplotlib或seaborn来修复(目前,这意味着从github安装海运的开发版本)。
https://stackoverflow.com/questions/25271660
复制相似问题