Random DataFrame just to show my issue :
numbers = pd.Series(np.random.choice(10,50), name='numbers')
colors=pd.Series(np.random.choice(['A','B'],50), name='colors')
df = pd.concat([numbers, colors], axis=1)
I'm plotting a histogram using Seaborn, legend displays just fine by default :
sns.histplot(data=df, x='numbers', hue='colors')
plt.show()
When trying to move my legend using loc, I get an empty square in the desired location instead :
sns.histplot(data=df, x='numbers', hue='colors')
plt.legend(loc="upper left")
plt.show()
How can I move my legend?