https://github.com/gwastro/pycbc
Raw File
Tip revision: ea06aa97fc4924ca299fe3b992a4eece118c04b2 authored by Duncan Brown on 08 September 2017, 12:09:29 UTC
Set for 1.8.0 release (#1912)
Tip revision: ea06aa9
plot.py
""" Plotting utilities and premade plot configurations
"""

def hist_overflow(val, val_max, **kwds):
    """ Make a histogram with an overflow bar above val_max """
    import pylab, numpy

    overflow = len(val[val>=val_max])
    pylab.hist(val[val<val_max], **kwds)
        
    if 'color' in kwds:
        color = kwds['color']
    else:
        color = None    
 
    if overflow > 0:
        rect = pylab.bar(val_max+0.05, overflow, .5, color=color)[0]
        pylab.text(rect.get_x(), 
                   1.10*rect.get_height(), '%s+' % val_max)
    
back to top