def plot_qq_norm(fignum, Y, title):
    """
    makes a Quantile-Quantile plot for data
    Parameters
    _________
    fignum : matplotlib figure number
    Y : list or array of data
    title : title string for plot

    Returns
    ___________
    d,dc : the values for D and Dc (the critical value)
       if d>dc, likely to be normally distributed (95\% confidence)
    """
    plt.figure(num=fignum)
    if type(Y) == list:
        Y = np.array(Y)
    Y = np.sort(Y)  # sort the data
    n = len(Y)
    d, mean, sigma = k_s(Y)
    dc = old_div(0.886, np.sqrt(float(n)))
    X = []  # list for normal quantile
    for i in range(1, n + 1):
        p = old_div(float(i), float(n + 1))
        X.append(qsnorm(p))
    plt.plot(X, Y, 'ro')
    plt.title(title)
    plt.xlabel('Normal Quantile')
    plt.ylabel('Data Quantile')
    bounds = plt.axis()
    notestr = 'N: ' + '%i' % (n)
    plt.text(-.9 * bounds[1], .9 * bounds[3], notestr)
    notestr = 'mean: ' + '%8.3e' % (mean)
    plt.text(-.9 * bounds[1], .8 * bounds[3], notestr)
    notestr = 'std dev: ' + '%8.3e' % (sigma)
    plt.text(-.9 * bounds[1], .7 * bounds[3], notestr)
    notestr = 'D: ' + '%8.3e' % (d)
    plt.text(-.9 * bounds[1], .6 * bounds[3], notestr)
    notestr = 'Dc: ' + '%8.3e' % (dc)
    plt.text(-.9 * bounds[1], .5 * bounds[3], notestr)
    return d, dc
makes a Quantile-Quantile plot for data
    Parameters
    _________
    fignum : matplotlib figure number
    Y : list or array of data
    title : title string for plot

    Returns
    ___________
    d,dc : the values for D and Dc (the critical value)
       if d>dc, likely to be normally distributed (95\% confidence)