[英]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.