0

enter image description here

I'm trying to get the value of each bar at its top, but I couldn't make it. here is a screenshot of my work and here is the code:

import matplotlib
import matplotlib.pyplot as plt
%matplotlib inline
x=df["Unnamed: 0"]
x_pos=[i for i, _ in enumerate(x)]
ax=df.plot(kind="bar",figsize=(20,8),width=0.8,color=["#5cb85c","#5bc0de","#d9534f"])
plt.title("percentage of respondents' Interest in Data Science Areas",fontsize=16)
plt.xticks(x_pos,x)
for spine in ax.spines:
    ax.spines[spine].set_visible(False)
plt.show()
  • Does this answer your question? [How to display the value of the bar on each bar with pyplot.barh()?](https://stackoverflow.com/questions/30228069/how-to-display-the-value-of-the-bar-on-each-bar-with-pyplot-barh) – Yi Zhao Apr 18 '20 at 12:18
  • 2
    Does this answer your question? [Adding value labels on a matplotlib bar chart](https://stackoverflow.com/questions/28931224/adding-value-labels-on-a-matplotlib-bar-chart) – Amal Ts Apr 18 '20 at 12:19

0 Answers0