Note that when you aren't using hue
, no legend is added as the names and colors are given by the x tick labels.
CodePudding user response:
You can add a legend manually by passing a list of the desired labels like this:
plt.legend(labels = ['type 1', 'type 2'])
here is a nice blog post on the topic: https://www.delftstack.com/howto/seaborn/legend-seaborn-plot/