Reputation: 301
I have created the following plot in Seaborn using:
ax = sns.factorplot(x='metric', y='number', hue='drop', data=df, kind='bar')
plt.legend(loc='best')
plt.subplots_adjust(top=.925)
ax._legend.remove()
sns.despine(ax=ax)
plt.show()
However, this throws an error:
AttributeError: 'FacetGrid' object has no attribute 'spines'
I need to either turn the spines white or remove them, how can you do this for a factorplot/FacetGrid?
Upvotes: 2
Views: 894
Reputation: 980
You can replace the following line
sns.despine(ax=ax)
with
ax.despine(left=True, bottom=True)
Note: The name ax
is misleading, grid
would be more indicative of what it is (a FacetGrid
object).
Upvotes: 1