Пример #1
0
def track_len_hists(comp_lst,conn,ax=None,*args,**kwargs):
    """makes histograms of the track lengths for the tracking computations in comp_lst """

    res = [_extract_track_lengths(c,conn) for c in comp_lst]
    hist_res = [np.histogram(r[0],bins=np.max(r[0])) + (r[1],r[2]) for r in res]

    tmps = [d[1] for d in res]
    cm = plots.color_mapper(np.min(tmps),np.max(tmps))
    
    if ax is None:
        ax = plots.set_up_axis('n*dtime [s]','cumsum $n P(n)$','',func = matplotlib.axes.Axes.plot)
        
    for hr in hist_res:
        temp = hr[2]
        ax.plot(np.cumsum((np.diff(hr[1]))+hr[1][0])*hr[3]/1000,np.cumsum(hr[0]*(hr[1][:-1]))/np.sum(hr[0]*(hr[1][:-1]))
                      ,label='%(#)0.1f C'%{'#':temp},color=cm.get_color(temp),*args,**kwargs)