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
  • 2
    can you provide the whole data/code to reproduce a minimal graph? Commented Sep 26, 2022 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'). Commented Sep 26, 2022 at 12:17

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.