# Path: jr/plot/base.py
# def plot_sem(x, y, robust=False, **kwargs):
#     """
#     Parameters
#     ----------
#     x : list | np.array()
#     y : list | np.array()
#     robust : bool
#         If False use mean + std,
#         If True median + mad
#     ax
#     alpha
#     color
#     line_args
#     err_args
# 
#     Returns
#     -------
#     ax
# 
#     Adapted from http://tonysyu.github.io/plotting-error-bars.html#.VRE9msvmvEU
#     """
#     x, y = np.array(x), np.array(y)
#     if robust:
#         m = np.nanmedian(y, axis=0)
#         std = median_abs_deviation(y, axis=0)
#     else:
#         m = np.nanmean(y, axis=0)
#         std = np.nanstd(y, axis=0)
#     n = y.shape[0] - np.sum(np.isnan(y), axis=0)
# 
#     return plot_eb(x, m, std / np.sqrt(n), **kwargs)


import numpy as np
import warnings
import matplotlib.pyplot as plt
    import matplotlib.colors as mcol
    import matplotlib.colors as mcol
from ..plot import plot_sem
    from mne.decoding import GeneralizationAcrossTime
    from gat.utils import GAT
                ylabel = 'Prediction'

            # loop around pred_type
            values = np.transpose(values, [2, 0, 1, 3])

        # select time
        time_line = list()
        for value in values:
            time_line.append(_select_time_line(value, time, gat.train_times_,
                                               gat.test_times_))
        time_line_list.append(time_line)
    time_line_list = np.transpose(time_line_list, [1, 0, 2])
    times = [gat_list[0].test_times_['times']]
    times = np.linspace(np.min([np.min(ttimes) for ttimes in times]),
                        np.max([np.max(ttimes) for ttimes in times]),
                        np.shape(time_line_list)[2])

    # Plot
    if ax is None:
        fig, ax = plt.subplots(1, 1)

    if color is None:
        cmap = mcol.LinearSegmentedColormap.from_list('RdPuBu', ['r', 'b'])
        color = [cmap(i) for i in np.linspace(0, 1, len(time_line_list))]
    if isinstance(color, str):
        color = [color]
    if len(color) != len(gat_list):
        color = [color[idx % len(color)] for idx in range(len(time_line_list))]

    for time_line, col, lab in zip(time_line_list, color, label):

# Path: jr/plot/base.py
# def plot_sem(x, y, robust=False, **kwargs):
#     """
#     Parameters
#     ----------
#     x : list | np.array()
#     y : list | np.array()
#     robust : bool
#         If False use mean + std,
#         If True median + mad
#     ax
#     alpha
#     color
#     line_args
#     err_args
# 
#     Returns
#     -------
#     ax
# 
#     Adapted from http://tonysyu.github.io/plotting-error-bars.html#.VRE9msvmvEU
#     """
#     x, y = np.array(x), np.array(y)
#     if robust:
#         m = np.nanmedian(y, axis=0)
#         std = median_abs_deviation(y, axis=0)
#     else:
#         m = np.nanmean(y, axis=0)
#         std = np.nanstd(y, axis=0)
#     n = y.shape[0] - np.sum(np.isnan(y), axis=0)
# 
#     return plot_eb(x, m, std / np.sqrt(n), **kwargs)


# Path: jr/gat/plot.py
import numpy as np
import warnings
import matplotlib.pyplot as plt
    import matplotlib.colors as mcol
    import matplotlib.colors as mcol
from ..plot import plot_sem
    from mne.decoding import GeneralizationAcrossTime
    from gat.utils import GAT

                ylabel = 'Prediction'

            # loop around pred_type
            values = np.transpose(values, [2, 0, 1, 3])

        # select time
        time_line = list()
        for value in values:
            time_line.append(_select_time_line(value, time, gat.train_times_,
                                               gat.test_times_))
        time_line_list.append(time_line)
    time_line_list = np.transpose(time_line_list, [1, 0, 2])
    times = [gat_list[0].test_times_['times']]
    times = np.linspace(np.min([np.min(ttimes) for ttimes in times]),
                        np.max([np.max(ttimes) for ttimes in times]),
                        np.shape(time_line_list)[2])

    # Plot
    if ax is None:
        fig, ax = plt.subplots(1, 1)

    if color is None:
        cmap = mcol.LinearSegmentedColormap.from_list('RdPuBu', ['r', 'b'])
        color = [cmap(i) for i in np.linspace(0, 1, len(time_line_list))]
    if isinstance(color, str):
        color = [color]
    if len(color) != len(gat_list):
        color = [color[idx % len(color)] for idx in range(len(time_line_list))]

    for time_line, col, lab in zip(time_line_list, color, label):

        plot_sem(times, time_line, ax=ax, color=col,