exp1orer
exp1orer

Reputation: 12039

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.

Upvotes: 0

Views: 998

Answers (1)

mwaskom
mwaskom

Reputation: 49022

This error happens with seaborn 0.3.1 and matplotlib < 1.2, but can be fixed by updating either matplotlib or seaborn (currently that means installing the development version of seaborn from github).

Upvotes: 2

Related Questions