epidemioptim/analysis/plots.py
def plot_algo_fronts(folder):
    """
    Plot Pareto fronts of all runs for a given algorithm.

    Parameters
    ----------
    folder: str
        Directory of the algorithm (full of directories, one for each run).

    """
    print('\n\tPlotting: ', folder.split('/')[-2])
    all_data = np.loadtxt(folder + 'res/all_data_pareto_{}.txt'.format(SWITCH))
    all_data_std = np.loadtxt(folder + 'res/all_data_pareto_std_{}.txt'.format(SWITCH))

    n_lines = all_data.shape[0]
    artists, ax = setup_figure()
    inds = np.arange(0, XLIM[1], X_STEP)
    for i in range(n_lines):
        data = all_data[i]
        data_std = all_data_std[i]
        # plot all lines (one per run)
        color = matplotlib_colors[i]
        plt.plot(inds, data, c=color, linewidth=LINEWIDTH)
    central = LINE(all_data)
    errs = ERR_MIN(all_data), ERR_MAX(all_data)
    plt.plot(inds, central, linestyle='--', c='k', linewidth=3*LINEWIDTH)
    plt.fill_between(inds, errs[0], errs[1], color='k', alpha=ALPHA)
    plt.savefig(folder + 'res/all_pareto_{}.pdf'.format(SWITCH))
    plt.close('all')

    Plot Pareto fronts of all runs for a given algorithm.

    Parameters
    ----------
    folder: str
        Directory of the algorithm (full of directories, one for each run).

    
Plot Pareto fronts of all runs for a given algorithm.
Parameters

str
Directory of the algorithm (full of directories, one for each run).
Plot Pareto fronts of all runs for a given algorithm . Parameters str Directory of the algorithm ( full of directories one for each run ) .
def plot_algo_fronts(folder):
    print('\n\tPlotting: ', folder.split('/')[-2])
    all_data = np.loadtxt(folder + 'res/all_data_pareto_{}.txt'.format(SWITCH))
    all_data_std = np.loadtxt(folder + 'res/all_data_pareto_std_{}.txt'.format(SWITCH))
    n_lines = all_data.shape[0]
    artists, ax = setup_figure()
    inds = np.arange(0, XLIM[1], X_STEP)
    for i in range(n_lines):
        data = all_data[i]
        data_std = all_data_std[i]
        color = matplotlib_colors[i]
        plt.plot(inds, data, c=color, linewidth=LINEWIDTH)
    central = LINE(all_data)
    errs = ERR_MIN(all_data), ERR_MAX(all_data)
    plt.plot(inds, central, linestyle='--', c='k', linewidth=3*LINEWIDTH)
    plt.fill_between(inds, errs[0], errs[1], color='k', alpha=ALPHA)
    plt.savefig(folder + 'res/all_pareto_{}.pdf'.format(SWITCH))
    plt.close('all')
def plot_algo_fronts ( folder ) : print ( '\n\tPlotting: ' , folder . split ( '/' ) [ - 2 ] ) all_data = np . loadtxt ( folder + 'res/all_data_pareto_{}.txt' . format ( SWITCH ) ) all_data_std = np . loadtxt ( folder + 'res/all_data_pareto_std_{}.txt' . format ( SWITCH ) ) n_lines = all_data . shape [ 0 ] artists , ax = setup_figure ( ) inds = np . arange ( 0 , XLIM [ 1 ] , X_STEP ) for i in range ( n_lines ) : data = all_data [ i ] data_std = all_data_std [ i ] color = matplotlib_colors [ i ] plt . plot ( inds , data , c = color , linewidth = LINEWIDTH ) central = LINE ( all_data ) errs = ERR_MIN ( all_data ) , ERR_MAX ( all_data ) plt . plot ( inds , central , linestyle = '--' , c = 'k' , linewidth = 3 * LINEWIDTH ) plt . fill_between ( inds , errs [ 0 ] , errs [ 1 ] , color = 'k' , alpha = ALPHA ) plt . savefig ( folder + 'res/all_pareto_{}.pdf' . format ( SWITCH ) ) plt . close ( 'all' )
Plot Pareto fronts of all runs for a given algorithm.
Plot Pareto fronts of all runs for a given algorithm .
"""
    Plot Pareto fronts of all runs for a given algorithm.

    Parameters
    ----------
    folder: str
        Directory of the algorithm (full of directories, one for each run).

    """ # plot all lines (one per run)
folder