0

This is what I've written so far, but I'm not sure how to add the values at the top of each bar.

# Visualize monthly revenues for top 4 sources.
top_four.pivot(index = 'month', columns = 'source_id', values = 'revenue').plot(kind='bar', 
                                                figsize=(20, 10), 
                                                color=['cornflowerblue','salmon','powderblue','darkseagreen'], 
                                                rot=0)  
plt.title("Monthly Revenue for Top 4 Source ID's", y = 1.03, fontsize=30) 
plt.xlabel("Date [Month]", labelpad=24, fontsize=20) 
plt.ylabel("Revenue in USD", labelpad=20, fontsize=20)

add

miquiztli_
  • 131
  • 1
  • 8
  • check out the autolabel in this example. https://matplotlib.org/2.0.2/examples/api/barchart_demo.html – J'e Sep 21 '20 at 19:49
  • 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) – Roim Sep 21 '20 at 20:06

0 Answers0