Changeset 469

Show
Ignore:
Timestamp:
09/21/10 10:00:33 (20 months ago)
Author:
pierre
Message:

harmonization between the plots of cv_isi_hist and isi_hist and the normed flag of the histogram

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/signals/spikes.py

    r468 r469  
    13291329        isis          = numpy.concatenate(self.isi()) 
    13301330        if newnum: 
    1331             values, xaxis = numpy.histogram(isis, bins=bins, normed=True, new=newnum) 
     1331            values, xaxis = numpy.histogram(isis, bins=bins, new=newnum) 
    13321332            xaxis = xaxis[:-1] 
    13331333        else: 
    1334             values, xaxis = numpy.histogram(isis, bins=bins, normed=True, new=True) 
     1334            values, xaxis = numpy.histogram(isis, bins=bins, new=True) 
    13351335        subplot       = get_display(display) 
    13361336        if not subplot or not HAVE_PYLAB: 
     
    13401340            ylabel = "Probability" 
    13411341            set_labels(subplot, xlabel, ylabel) 
    1342             subplot.plot(xaxis, values, **kwargs) 
     1342            subplot.plot(xaxis, values/float(values.sum()), **kwargs) 
    13431343            subplot.set_yticks([]) # arbitrary units 
    13441344            pylab.draw() 
     
    14241424        cvs = self.cv_isi(float_only=True) 
    14251425        if newnum: 
    1426             values, xaxis = numpy.histogram(cvs, bins=bins, normed=True, new=newnum) 
     1426            values, xaxis = numpy.histogram(cvs, bins=bins, new=newnum) 
    14271427            xaxis = xaxis[:-1] 
    14281428        else: 
    1429             values, xaxis = numpy.histogram(cvs, bins=bins, normed=True, new=True) 
     1429            values, xaxis = numpy.histogram(cvs, bins=bins, new=True) 
    14301430        subplot       = get_display(display) 
    14311431        if not subplot or not HAVE_PYLAB: 
     
    14351435            ylabel = "% of Neurons" 
    14361436            set_labels(subplot, xlabel, ylabel) 
    1437             subplot.plot(xaxis, values, **kwargs) 
     1437            subplot.plot(xaxis, values/float(values.sum()), **kwargs) 
    14381438            pylab.draw() 
    14391439 
     
    15731573        else: 
    15741574            if newnum: 
    1575                 values, xaxis = numpy.histogram(rates, nbins, normed=True, new=newnum) 
     1575                values, xaxis = numpy.histogram(rates, nbins, new=newnum) 
    15761576                xaxis = xaxis[:-1] 
    15771577            else: 
    1578                 values, xaxis = numpy.histogram(rates, nbins, normed=True) 
     1578                values, xaxis = numpy.histogram(rates, nbins) 
    15791579            xlabel = "Average Firing Rate (Hz)" 
    15801580            ylabel = "% of Neurons" 
    15811581            set_labels(subplot, xlabel, ylabel) 
    1582             subplot.plot(xaxis, values, **kwargs) 
     1582            subplot.plot(xaxis, values/float(values.sum()), **kwargs) 
    15831583            pylab.draw() 
    15841584             
     
    19761976        See J. D. Victor and K. P. Purpura, 
    19771977            Nature and precision of temporal coding in visual cortex: a metric-space 
    1978                 analysis., 
     1978            analysis., 
    19791979            J Neurophysiol,76(2):1310-1326, 1996 
    19801980         
     
    21582158        t_start  = numpy.floor(self.t_start/time_bin) 
    21592159        t_stop   = numpy.floor(self.t_stop/time_bin) 
     2160 
    21602161        for ev in events: 
    21612162           ev = numpy.floor(ev/time_bin)