1

We could display a values from dataframe to the graph using the brand new feature of the matplotlib in bar graph.

https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.bar_label.html

But how to do this problem, on a line chart? To display value from dataframe exactly above markers of a seaborn lineplot. Similiar to the below question, but in a line chart.

https://stackoverflow.com/a/68323374/15514664

  • 3
    Well, `bar_label()` is for **bar** plots. For a line plot, it depends a lot on the values, their density, their distribution, their closeness to decide upon a good place to add annotations. You typically want text to have some padding, avoid overlap with other texts, avoid overlap with the curve, ... This will be different for each situation, you'll need to write some loop and some logic yourself. If the exact values are very important, you might consider a table instead of a line plot. As you forgot to add data, code and a plot, it is hard to guess what exactly you need. – JohanC Feb 08 '22 at 07:52

0 Answers0