예제 #1
0
def plot_resampled_dists(mft, fig_title = 'Permutation test', fig_no = 1, x_offset = 0.1):
    n_resample = mft['n_resample']
    
    print('Permutations evaluated: {}'.format(mft['n_resample']))
    print('P values    KL: {}'.format(mft['KL_data']['p_vals']))
    print('P values means: {}'.format(mft['means_data']['p_vals']))
    if 'pref_data' in mft.keys():
        print('P values pref: {}'.format(mft['pref_data']['p_vals']))


    #Plotting
    p.figure(fig_no)
    p.clf()
    rp.pop_scatter_plot(mft['fit_A'], col = 'b', clf = True,  subplot = (3,1,1), x_offset = -x_offset)
    rp.pop_scatter_plot(mft['fit_B'], col = 'r', clf = False, subplot = (3,1,1), x_offset =  x_offset)
    
    if fig_title:
        p.suptitle(fig_title)

    p.subplot(3,1,2)
    _plot_dist(mft, 'KL')

    p.subplot(3,1,3)
    _plot_dist(mft, 'means')