def plot_figure(f, ax, args):
    systems = args['systems']
    varis = args['varis']
    input_dir = args['input_dir']
    tag = args['tag']
    post_lfes = args['post_lfes']
    stacking_enes = args['stacking_enes']
    if (stacking_enes is not None):
        stacking_enes = [abs(e) for e in stacking_enes]
        cmap = plotutils.create_truncated_colormap(0.2, 0.8, name='plasma')
        increment = (stacking_enes[1] - stacking_enes[0])
        (cmap, norm, colors) = plotutils.create_segmented_colormap(cmap, stacking_enes, increment)
    else:
        cmap = cm.get_cmap('tab10')
        colors = [cmap(i) for i in range(len(systems))]
    for i in range(len(systems)):
        system = systems[i]
        vari = varis[i]
        post_lfe = post_lfes[i]
        if (post_lfe != ''):
            post_lfe = ('-' + post_lfe)
        inp_filebase = f'{input_dir}/{system}-{vari}_lfes{post_lfe}-{tag}'
        lfes = pd.read_csv(f'{inp_filebase}.aves', sep=' ', index_col=0)
        lfe_stds = pd.read_csv(f'{inp_filebase}.stds', sep=' ', index_col=0)
        temp = lfes.columns[0]
        lfes = lfes[temp]
        lfes = (lfes - lfes[0])
        lfe_stds = lfe_stds[temp]
        label = f'{system}-{vari}'
        ax.errorbar(lfes.index, lfes, yerr=lfe_stds, marker='o', label=label, color=colors[i])
    if (stacking_enes is not None):
        label = '$-U_\\text{stack} / \\SI{1000}{\\kb\\kelvin}$'
        tick_labels = [f'${(e / 1000):.1f}$' for e in stacking_enes]
        plotutils.plot_segmented_colorbar(f, ax, cmap, norm, label, tick_labels, 'horizontal')
def plot_figure(f, ax, args):
    systems = args['systems']
    varis = args['varis']
    input_dir = args['input_dir']
    tag = args['tag']
    post_lfes = args['post_lfes']
    stacking_enes = args['stacking_enes']
    if (stacking_enes is not None):
        stacking_enes = [abs(e) for e in stacking_enes]
        cmap = plotutils.create_truncated_colormap(0.2, 0.8, name='plasma')
        increment = (stacking_enes[1] - stacking_enes[0])
        (cmap, norm, colors) = plotutils.create_segmented_colormap(cmap, stacking_enes, increment)
    else:
        cmap = cm.get_cmap('tab10')
        colors = [cmap(i) for i in range(len(systems))]
    for i in range(len(systems)):
        system = systems[i]
        vari = varis[i]
        post_lfe = post_lfes[i]
        if (post_lfe != ):
            post_lfe = ('-' + post_lfe)
        inp_filebase = f'{input_dir}/{system}-{vari}_lfes{post_lfe}-{tag}'
        lfes = pd.read_csv(f'{inp_filebase}.aves', sep=' ', index_col=0)
        lfe_stds = pd.read_csv(f'{inp_filebase}.stds', sep=' ', index_col=0)
        temp = lfes.columns[0]
        lfes = lfes[temp]
        lfes = (lfes - lfes[0])
        lfe_stds = lfe_stds[temp]
        label = f'{system}-{vari}'
        ax.errorbar(lfes.index, lfes, yerr=lfe_stds, marker='o', label=label, color=colors[i])
    if (stacking_enes is not None):
        label = '$-U_\\text{stack} / \\SI{1000}{\\kb\\kelvin}$'
        tick_labels = [f'${(e / 1000):.1f}$' for e in stacking_enes]
        plotutils.plot_segmented_colorbar(f, ax, cmap, norm, label, tick_labels, 'horizontal')