#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2013
    Posts
    7
    Rep Power
    0

    Strange thing about plotting histogram


    hi,
    I am try to plot a histogram by using pylab ,but after using normed=True, it shows not only the normalized one but also the original one which visually dominats the normalized one. I want to get rid of it.

    How possibly can I get rid of the original?
    I know it's strange ,because normally there should only be the normalized one existing. But why this happened? I use eclipse.

    Does anyone of you have information about it ?

    my code
    PHP Code:
       from scipy import *
    import pylab
        data
    =norm.rvs(2,0.5,size=500)
        
    bins=pylab.linspace(data.min(),data.max(),50)
        
    #myplot(x,data)
        
    pylab.hist(data,bins,normed=True)
        
    pylab.show() 
    Thank you very much
  2. #2
  3. Contributing User
    Devshed Demi-God (4500 - 4999 posts)

    Join Date
    Aug 2011
    Posts
    4,837
    Rep Power
    480
    This program, slightly different from yours, seems to work. I use linux. The area of the histogram "looks like 1" with normed=True, and certainly not with normed=False option. In both cases there's only one histogram colored blue. Then again, if there were two histograms I suppose the one with longer bars would occlude the scaled short one if it were drawn second.


    import scipy.stats
    import pylab
    data=scipy.stats.norm.rvs(2,0.5,size=500)
    bins=pylab.linspace(data.min(),data.max(),50)
    pylab.hist(data,bins,normed=True or False)
    pylab.show()
    [code]Code tags[/code] are essential for python code and Makefiles!

IMN logo majestic logo threadwatch logo seochat tools logo