1

I have a bar chart like this

here is my chart

image

I have created the chart by,

y_pos=np.arange(len(plot_label))

plt.bar(y_pos, plot_value, align='center', alpha=0.5 )
plt.xticks(y_pos, plot_label)
plt.ylabel('axis')
plt.title('Title')

I want to add the value counts at the top of each bar, for example as a label.

Chandresh Khambhayata
  • 1,748
  • 2
  • 31
  • 60
pyco
  • 191
  • 1
  • 2
  • 10
  • see the answer to the question I flagged as duplicate -- basically you only have to replace the label in that answer with the value count. – Thomas Kühn Jul 20 '17 at 07:13
  • @Mel how can I change the values for bar_vertical, they gave for barh – pyco Jul 20 '17 at 07:19
  • @ThomasKühn not working I replaced the label – pyco Jul 20 '17 at 07:30
  • https://matplotlib.org/examples/api/barchart_demo.html – DavidG Jul 20 '17 at 08:47
  • It solved my problem what to do now – pyco Jul 20 '17 at 09:26
  • shall I delete this question as it is duplicate ? – pyco Jul 20 '17 at 09:26
  • As this question is now marked as duplicate, it is completely your choice. It may usually be beneficial not to delete duplicates as they might help others to find the answer more easily (different questions use different wordings for the same problem, different searches then lead to the same answers). However, here, I do not see much benefit as the question essentially uses the same wording. The takehome message from this is rather: Next time, please seach for an answer yourself instead of letting others do it for you. – ImportanceOfBeingErnest Jul 20 '17 at 11:26

0 Answers0