简体   繁体   中英

Seaborn FactorPlot throws TypeError

sns.FactorPlot is throwing me a TypeError when it tries to set_title. This happens on an example dataframe, but more worryingly, also happens on the example from the documentation.

So

import seaborn as sns
exercise = sns.load_dataset('exercise')
sns.factorplot("kind", "pulse", "diet", exercise, kind="point")

Returns a long traceback. Here's the end of it:

*/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'

When I run this in an iPython Notebook with pylab inline enabled, the plot displays fine underneath the traceback. But I don't understand why I'm getting this error, especially with an example from the docs.

这个错误发生在seaborn 0.3.1和matplotlib <1.2上,但是可以通过更新matplotlib或seaborn来修复(当前这意味着从github安装seaborn的开发版本)。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM