1

Hello first of all I am new to pandas . I wanted to bar plot my values and index , everything turned out well but as you can see on the top right of this image it is also showing me the column which i basically don't want. Is there anyway that i can just show the bar plot with index and values and not column? Thank you. I really appreciate your help.

df=pd.DataFrame([11,62,82,120,125,141,192,38],index=['10-20','21-30','31-40','41-50','51-60','61-70','71-80','81-90']) 
    
    ax = df.plot(kind='bar',stacked = False, colormap = 'Paired')
    for p in ax.patches:
            ax.annotate(np.round(p.get_height(),decimals=0), (p.get_x()+p.get_width()/2., p.get_height()), ha='center', va='center', xytext=(2, 10), textcoords='offset points')
    plt.ylabel('Number of co-occurrences ')
    plt.title('Occurences by Age Group')
plt.show()
Acerace.py
  • 679
  • 3
  • 9
  • 25

0 Answers0