plt.xlabel(r'Displacement Along Attractor [$\mu$m]')
    plt.ylabel(r'Force on 500e$^-$ [N]')
    plt.annotate(ann_str, xy=(0.2, 0.9), xycoords='axes fraction')
    plt.tight_layout()
    plt.grid()

    plt.show()
    





for ddir in data_dirs:

    paths = gu.build_paths(ddir, opt_ext=opt_ext)

    datafiles = bu.find_all_fnames(ddir)
    p0_bead = p0_bead_dict[paths['date']]

    if load_files:
        agg_dat = gu.AggregateData(datafiles, p0_bead=p0_bead, harms=harms, \
                                   elec_drive=False, elec_ind=0, plot_harm_extraction=False, \
                                   tfdate=tfdate)       

        agg_dat.save(paths['agg_path'])

    else:
        agg_dat = gu.AggregateData([], p0_bead=p0_bead, harms=harms)
        agg_dat.load(paths['agg_path'])
        agg_dat.p0_bead = p0_bead
for ddir in data_dirs:
    # Skip the ones I've already calculated
    #if ddir == data_dirs[0]:
    #    continue
    print()

    aux_path_base = ddir.replace('/data/new_trap/', '/data/new_trap_processed/processed_files/')
    aux_path = os.path.join(aux_path_base, '{:s}_aux.pkl'.format(substr))
    try:
        aux_data = pickle.load( open(aux_path, 'rb') )
    except:
        print("Couldn't load auxiliary data file")
        aux_data = []


    paths = gu.build_paths(ddir, opt_ext, pardirs_in_name=pardirs_in_name, new_trap=new_trap)
    agg_path = paths['agg_path']
    plot_dir = paths['plot_dir']
    p0_bead = p0_bead_dict[paths['date']]

    agg_load_path = agg_path.replace(user_save_ext, user_load_ext)

    print('----------------------------------')
    if reprocess:
        print('Loading files from:')
        print('     {:s}'.format(ddir))
    else:
        print('Loading aggregate data from:')
        print('     {:s}'.format(agg_load_path))

    print('----------------------------------')
    opt_ext += '_{:s}'.format(substr)


def volume_ndim_ellipsoid(axes):
    ndim = len(axes)
    prefac = np.pi**(float(ndim) / 2.0) / special.gamma(0.5 * float(ndim) + 1)
    return prefac * np.prod(axes)


for ddir in data_dirs:
    # Skip the ones I've already calculated
    #if ddir == data_dirs[0]:
    #    continue
    print()

    paths = gu.build_paths(ddir, opt_ext=opt_ext, new_trap=new_trap)
    p0_bead = p0_bead_dict[paths['date']]

    agg_dat = gu.AggregateData([], p0_bead=p0_bead, harms=harms)
    if load_agg:
        agg_dat.load(paths['agg_path'])
        agg_dat.gfuncs_class.reload_grav_funcs()
        bu.make_all_pardirs(paths['alpha_dict_path'])
        agg_dat.save_alpha_dict(paths['alpha_dict_path'])
        #agg_dat.save_alpha_arr(alpha_arr_path)
    elif load_alpha_arr:
        agg_dat.load_alpha_dict(paths['alpha_dict_path'])

    if load_agg and plot:
        agg_dat.plot_force_plane(resp=0, fig_ind=1, show=False)
        agg_dat.plot_force_plane(resp=1, fig_ind=2, show=False)