简体   繁体   中英

Label Individual Lines in Seaborn Lineplot

I have the followed dataframe:

在此处输入图像描述

I then use this code to generate the plot:

plt.figure(figsize=(10,8))
sns.lineplot(x="Minutes", y="Hours", data=df1, hue="Product")
plt.show()

And this is the result: 在此处输入图像描述

Rather than have the label for each line in the legend, how do I get them to appear on the plot itself ie slightly to the right of each individual/associated line or tethered in some way to each line?

As far as I know this are the options to position the legend in the plot: Best 0 Upper right 1 Upper left 2 Lower left 3 Lower right 4 Right 5 Center left 6 Center right 7 Lower center 8 Upper center 9 center 10

So I think it´s not posible to do what you ask for.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM