# Path: neurokit/statistics/statistics.py
# def normal_range(mean, sd, treshold=1.28):
#     """
#     Returns a bottom and a top limit on a normal distribution portion based on a treshold.
# 
#     Parameters
#     ----------
#     treshold : float
#         maximum deviation (in terms of standart deviation). Rule of thumb of a gaussian distribution: 2.58 = keeping 99%, 2.33 = keeping 98%, 1.96 = 95% and 1.28 = keeping 90%.
# 
#     Returns
#     ----------
#     (bottom, top) : tuple
#         Lower and higher range.
# 
#     Example
#     ----------
#     >>> import neurokit as nk
#     >>> bottom, top = nk.normal_range(mean=100, sd=15, treshold=2)
# 
#     Notes
#     ----------
#     *Authors*
# 
#     - `Dominique Makowski <https://dominiquemakowski.github.io/>`_
#     """
#     bottom = mean - sd*treshold
#     top = mean + sd*treshold
#     return(bottom, top)


from .statistics import normal_range
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt

    # Main
    plot = plt.figure(figsize=fig_size)

    layer1 = plot.add_subplot(111, projection="polar")
    bars1 = layer1.bar(theta+np.pi/len(scores), scores, width=width, bottom=0.0)

    layer1.yaxis.set_ticks(range(11))
    layer1.yaxis.set_ticklabels([])

    layer1.xaxis.set_ticks(theta+np.pi/len(scores))
    layer1.xaxis.set_ticklabels(labels, fontsize=labels_size)

    for index, bar in enumerate(bars1):
        if colors is not None:
            bar.set_facecolor(colors[index])
        bar.set_alpha(1)

    # Layer 2
    if distribution_means is not None and distribution_sds is not None:

        # Sanity check
        if isinstance(distribution_means, int):
            distribution_means = [distribution_means]*N
        if isinstance(distribution_sds, int):
            distribution_sds = [distribution_sds]*N

        # TODO: add convertion if those parameter are dict



# Path: neurokit/statistics/statistics.py
# def normal_range(mean, sd, treshold=1.28):
#     """
#     Returns a bottom and a top limit on a normal distribution portion based on a treshold.
# 
#     Parameters
#     ----------
#     treshold : float
#         maximum deviation (in terms of standart deviation). Rule of thumb of a gaussian distribution: 2.58 = keeping 99%, 2.33 = keeping 98%, 1.96 = 95% and 1.28 = keeping 90%.
# 
#     Returns
#     ----------
#     (bottom, top) : tuple
#         Lower and higher range.
# 
#     Example
#     ----------
#     >>> import neurokit as nk
#     >>> bottom, top = nk.normal_range(mean=100, sd=15, treshold=2)
# 
#     Notes
#     ----------
#     *Authors*
# 
#     - `Dominique Makowski <https://dominiquemakowski.github.io/>`_
#     """
#     bottom = mean - sd*treshold
#     top = mean + sd*treshold
#     return(bottom, top)


# Path: neurokit/statistics/plot.py
from .statistics import normal_range
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt


    # Main
    plot = plt.figure(figsize=fig_size)

    layer1 = plot.add_subplot(111, projection="polar")
    bars1 = layer1.bar(theta+np.pi/len(scores), scores, width=width, bottom=0.0)

    layer1.yaxis.set_ticks(range(11))
    layer1.yaxis.set_ticklabels([])

    layer1.xaxis.set_ticks(theta+np.pi/len(scores))
    layer1.xaxis.set_ticklabels(labels, fontsize=labels_size)

    for index, bar in enumerate(bars1):
        if colors is not None:
            bar.set_facecolor(colors[index])
        bar.set_alpha(1)

    # Layer 2
    if distribution_means is not None and distribution_sds is not None:

        # Sanity check
        if isinstance(distribution_means, int):
            distribution_means = [distribution_means]*N
        if isinstance(distribution_sds, int):
            distribution_sds = [distribution_sds]*N

        # TODO: add convertion if those parameter are dict



        bottoms, tops = normal_range(np.array(distribution_means), np.array(distribution_sds), treshold=treshold)