ctaplot/plots/plots.py
def plot_multiplicity_hist(multiplicity, ax=None, outfile=None, quartils=False, **kwargs):
    """
    Histogram of the telescopes multiplicity

    Parameters
    ----------
    multiplicity: `numpy.ndarray`
    ax: `matplotlib.pyplot.axes`
    outfile: string
    **kwargs: args for `matplotlib.pyplot.bar`
    """
    from matplotlib.ticker import MaxNLocator

    ax = plt.gca() if ax is None else ax
    ax.spines["top"].set_visible(False)
    ax.spines["right"].set_visible(False)

    m = np.sort(multiplicity)
    xmin = multiplicity.min()
    xmax = multiplicity.max()


    if 'label' not in kwargs:
        kwargs['label'] = 'Telescope multiplicity'

    n, bins, patches = ax.hist(multiplicity, bins=(xmax-xmin), range=(xmin, xmax), rwidth=0.7, align='left', **kwargs)
    ax.xaxis.set_major_locator(MaxNLocator(integer=True))

    x50 = m[int(np.floor(0.5 * len(m)))] + 0.5
    x90 = m[int(np.floor(0.9 * len(m)))] + 0.5
    if quartils and (xmin < x50 < xmax):
        ax.vlines(x50, 0, n[int(m[int(np.floor(0.5 * len(m)))])], label='50%')
    if quartils and (xmin < x90 < xmax):
        ax.vlines(x90, 0, n[int(m[int(np.floor(0.9 * len(m)))])], label='90%')

    ax.set_title("Telescope multiplicity")
    if type(outfile) is str:
        plt.savefig(outfile, bbox_inches="tight", format='png', dpi=200)

    return ax

    Histogram of the telescopes multiplicity

    Parameters
    ----------
    multiplicity: `numpy.ndarray`
    ax: `matplotlib.pyplot.axes`
    outfile: string
    **kwargs: args for `matplotlib.pyplot.bar`
    
Histogram of the telescopes multiplicity
Parameters


Histogram of the telescopes multiplicity Parameters
def plot_multiplicity_hist(multiplicity, ax=None, outfile=None, quartils=False, **kwargs):
    from matplotlib.ticker import MaxNLocator
    ax = plt.gca() if ax is None else ax
    ax.spines["top"].set_visible(False)
    ax.spines["right"].set_visible(False)
    m = np.sort(multiplicity)
    xmin = multiplicity.min()
    xmax = multiplicity.max()
    if 'label' not in kwargs:
        kwargs['label'] = 'Telescope multiplicity'
    n, bins, patches = ax.hist(multiplicity, bins=(xmax-xmin), range=(xmin, xmax), rwidth=0.7, align='left', **kwargs)
    ax.xaxis.set_major_locator(MaxNLocator(integer=True))
    x50 = m[int(np.floor(0.5 * len(m)))] + 0.5
    x90 = m[int(np.floor(0.9 * len(m)))] + 0.5
    if quartils and (xmin < x50 < xmax):
        ax.vlines(x50, 0, n[int(m[int(np.floor(0.5 * len(m)))])], label='50%')
    if quartils and (xmin < x90 < xmax):
        ax.vlines(x90, 0, n[int(m[int(np.floor(0.9 * len(m)))])], label='90%')
    ax.set_title("Telescope multiplicity")
    if type(outfile) is str:
        plt.savefig(outfile, bbox_inches="tight", format='png', dpi=200)
    return ax
def plot_multiplicity_hist ( multiplicity , ax = None , outfile = None , quartils = False , ** kwargs ) : from matplotlib . ticker import MaxNLocator ax = plt . gca ( ) if ax is None else ax ax . spines [ "top" ] . set_visible ( False ) ax . spines [ "right" ] . set_visible ( False ) m = np . sort ( multiplicity ) xmin = multiplicity . min ( ) xmax = multiplicity . max ( ) if 'label' not in kwargs : kwargs [ 'label' ] = 'Telescope multiplicity' n , bins , patches = ax . hist ( multiplicity , bins = ( xmax - xmin ) , range = ( xmin , xmax ) , rwidth = 0.7 , align = 'left' , ** kwargs ) ax . xaxis . set_major_locator ( MaxNLocator ( integer = True ) ) x50 = m [ int ( np . floor ( 0.5 * len ( m ) ) ) ] + 0.5 x90 = m [ int ( np . floor ( 0.9 * len ( m ) ) ) ] + 0.5 if quartils and ( xmin < x50 < xmax ) : ax . vlines ( x50 , 0 , n [ int ( m [ int ( np . floor ( 0.5 * len ( m ) ) ) ] ) ] , label = '50%' ) if quartils and ( xmin < x90 < xmax ) : ax . vlines ( x90 , 0 , n [ int ( m [ int ( np . floor ( 0.9 * len ( m ) ) ) ] ) ] , label = '90%' ) ax . set_title ( "Telescope multiplicity" ) if type ( outfile ) is str : plt . savefig ( outfile , bbox_inches = "tight" , format = 'png' , dpi = 200 ) return ax
Histogram of the telescopes multiplicity
Parameters
Histogram of the telescopes multiplicity Parameters
"""
    Histogram of the telescopes multiplicity

    Parameters
    ----------
    multiplicity: `numpy.ndarray`
    ax: `matplotlib.pyplot.axes`
    outfile: string
    **kwargs: args for `matplotlib.pyplot.bar`
    """
multiplicity
ax
outfile
quartils