0

I'm very confused to create a frequency histogram in python using matplotlib.pyplot.

I have two list: one is the frequency list and another is category list. E.g:

Frequency list:

freq = [123,142,543,77866,8,2424,3]

category list:

category = [-1.23,0,2.13,5.4345,7.45,9.00,12.32]

So, each item from freq list relates with the item from the category the same position, e.g: 123: -1.23, 543:0 ...

That's my doubt...

How to using those list in the hist ?

plt.hist(x, num_bins, normed=1, facecolor='green', alpha=0.5)

I'm very confused each parameters i have to use in the instruction..

Could you help me about it?

Here is the sample of hist I'd like to create.

enter image description here

tmdavison
  • 64,360
  • 12
  • 187
  • 165
Kadu
  • 343
  • 7
  • 17
  • I think you could find what youre looking for here: [link](http://matplotlib.org/1.2.1/api/pyplot_api.html?highlight=hist#matplotlib.pyplot.hist) – Harish Elumalai Mar 10 '16 at 22:49
  • 2
    There are many other duplicates as well. Just search for "matplotlib histogram with binned data" or similar – tmdavison Mar 10 '16 at 22:51

0 Answers0