Re: Untitled

From Colossal Leech, 3 Months ago, written in Plain Text, viewed 63 times. This paste is a reply to Untitled from Insensitive Agouti - view diff
URL http://codebin.org/view/2d333002 Embed
Download Paste or View Raw
  1. import matplotlib.pyplot as plt
  2.  
  3. # Assuming you have a list of categories and their values
  4. categories = ['Category1', 'Category2', 'Category3']
  5. values = [20, 35, 30]
  6.  
  7. plt.bar(categories, values)
  8.  
  9. # Loop to add values on each bar
  10. for i in range(len(values)):
  11.     plt.text(x = i, y = values[i]+0.5, s = values[i], ha = 'center')
  12.  
  13. plt.show()

Reply to "Re: Untitled"

Here you can reply to the paste above