Did you put plt.legend(loc='upper right') before or after the countplot?
– tdy
I put it after. I got my answer btw, g=sns.countplot(x=feature, hue='loss', data=data_tr, order=cat_order(feature)) g.figure.get_axes()[0].legend(loc='upper right')
– Sandeep Maurya
Sounds good. Feel free to post that as an official answer and accept it.
– tdy
We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.OkRead more
plt.legend(loc='upper right')
before or after thecountplot
? – tdy