0

Image

The attached image shows the image of the seaborn plot. The values shown on the top of the graph are already rounded in the dataframe but the plot does not show the rounded values.

How can I do that?

Rounded with:

data["Marks (%)"] =  data["Marks (%)"].apply(lambda x: round(x,1))

Seaborn code to showcase these values on top of the bar:

for i in ax.containers:
    ax.bar_label(i, fontsize = 14)
  • 2
    can you provide the whole data/code to reproduce a minimal graph? – mozway Sep 26 '22 at 12:06
  • It's very hard to guess how your data is structured. By default, seaborn's barplot takes the average of all y-values corresponding to the same x-value. Probably the easiest approach would be to use seaborn with the exact values, and then call `ax.bar_label(..., fmt='%.1f')`. – JohanC Sep 26 '22 at 12:17

0 Answers0