I have a boxplot and added a dot for each mean using the meanprops argument. I'd like to add a legend that tells people that the little red dot is the mean, but when I add the legend, it shows a duplicate legend entry for every box plot! Is there any way to have a legend with only a single item in it instead of a bajillion?
plt.figure(figsize=(20, 10))
sns.boxplot(data=country_ratings_df,
x='Country',
y='Stars',
order=country_ratings_grouped.index,
showmeans=True,
meanprops={'marker':'o',
'markerfacecolor':'red',
'markeredgecolor':'black',
'markersize':'7',
'alpha':0.5,
'label':'Mean'})
plt.title('Ramen Ratings by Country (Sorted by Mean Rating)', size=20)
plt.xlabel('Country', size=20)
plt.ylabel('Stars', size=20)
plt.xticks(fontsize=15)
plt.yticks(fontsize=15)
plt.grid(axis='x')
plt.xticks(rotation=90)
plt.legend()
plt.show()