-----
    Brief
    -----
    This plotting function ensures a graphical representation of maximum, minimum and average sample
    values registered on the entire EMG acquisition.

    -----------
    Description
    -----------
    Function intended to generate a single Bokeh figure with graphically describing and identifying
    some statistical parameters extracted from the analysis of the entire electromyographic (EMG) signal.

    Applied in the Notebook titled "EMG Analysis - Time and Frequency Parameters".

    ----------
    Parameters
    ----------
    time : list
        Time-axis linked to the acquired EMG signal samples.

    signal : list
        Acquired EMG signal samples.

    max_sample_value : float
        Maximum value registered in the acquired EMG samples.

    min_sample_value: float
        Minimum value registered in the acquired EMG samples.

    avg_sample_value : float
        Average value registered in the acquired EMG samples.

    std_sample_value : int
        Standard deviation of the acquired EMG sample values relatively to avg_sample_value.

def plot_emg_graphical_statistical(time, signal, max_sample_value, min_sample_value, avg_sample_value,
                                   std_sample_value):
    """
    -----
    Brief
    -----
    This plotting function ensures a graphical representation of maximum, minimum and average sample
    values registered on the entire EMG acquisition.

    -----------
    Description
    -----------
    Function intended to generate a single Bokeh figure with graphically describing and identifying
    some statistical parameters extracted from the analysis of the entire electromyographic (EMG) signal.

    Applied in the Notebook titled "EMG Analysis - Time and Frequency Parameters".

    ----------
    Parameters
    ----------
    time : list
        Time-axis linked to the acquired EMG signal samples.

    signal : list
        Acquired EMG signal samples.

    max_sample_value : float
        Maximum value registered in the acquired EMG samples.

    min_sample_value: float
        Minimum value registered in the acquired EMG samples.

    avg_sample_value : float
        Average value registered in the acquired EMG samples.

    std_sample_value : int
        Standard deviation of the acquired EMG sample values relatively to avg_sample_value.
    """

    # List that store the figure handler
    list_figures = []

    # Plotting of EMG.
    list_figures.append(figure(x_axis_label='Time (s)', y_axis_label='Electric Tension (mV)', x_range=(0, time[-1] + 0.50 * time[-1]), y_range=[-1.10, 1], **opensignals_kwargs("figure")))
    list_figures[-1].line(time, signal, legend="EMG Signal", **opensignals_kwargs("line"))

    # Representation of EMG and the determined parameters
    parameter_list = ["Maximum", "Minimum", "Average", "Standard Deviation"]
    for parameter in parameter_list:
        find_time_max = numpy.array(time)[numpy.where(numpy.array(signal) == max_sample_value)]
        find_time_min = numpy.array(time)[numpy.where(numpy.array(signal) == min_sample_value)]
        if parameter == "Maximum":
            list_figures[-1].circle(find_time_max, max_sample_value, radius = 0.5, fill_color=opensignals_color_pallet(),
                                    legend=parameter + " EMG")
        elif parameter == "Minimum":
            list_figures[-1].circle(find_time_min, min_sample_value, radius=0.5, fill_color=opensignals_color_pallet(),
                                    legend=parameter + " EMG")
        elif parameter == "Average":
            list_figures[-1].line([0, time[-1]], [avg_sample_value, avg_sample_value],
                                  legend=parameter + " EMG Sample", **opensignals_kwargs("line"))
        elif parameter == "Standard Deviation":
            box_annotation = BoxAnnotation(left=0, right=time[-1], top=avg_sample_value + std_sample_value,
                                           bottom=avg_sample_value - std_sample_value, fill_color="black",
                                           fill_alpha=0.3)
            list_figures[-1].rect(find_time_min, std_sample_value, width=0, height=0, fill_color="black", fill_alpha=0.3,
                                  legend="Average + Standard Deviation Zone")
            list_figures[-1].add_layout(box_annotation)

    # Show figure.
    opensignals_style(list_figures)
    show(list_figures[-1])