def show_simple_rd_all_fig(test_data_ids, Ns, samp_range):
    '\n    Plot relative distances from points found by fiber traversal or baseline.\n    test_ids, Ns, and samp_range should be as in show_traverse_re_fig.\n    '
    log = True
    mpl.rcParams['mathtext.default'] = 'regular'
    mpl.rcParams['pdf.fonttype'] = 42
    mpl.rcParams['ps.fonttype'] = 42
    buckets = None
    bins = None
    for samp in samp_range:
        for (test_data_id, N) in zip(test_data_ids, Ns):
            print(('samp %d, N %d' % (samp, N)))
            npz = np.load(('results/simple_rd_%s_N_%d_s_%d.npz' % (test_data_id, N, samp)))
            if (buckets is None):
                buckets = np.zeros(npz['traverse_buckets'].shape)
                bins = npz['bins']
            buckets += npz['traverse_buckets']
            buckets += npz['baseline_buckets']
    plt.figure(figsize=(8, 2.4))
    if log:
        buckets[(buckets > 0)] = np.log2(buckets[(buckets > 0)])
    plt.bar(left=bins[:(- 1)], height=buckets, width=(bins[1:] - bins[:(- 1)]), facecolor='none')
    plt.ylabel('# of pairs')
    plt.xlabel('$max_i|v_i^{(1)}-v_i^{(2)}|$')
    xmin_idx = int(((bins[:(- 1)] > (- 1000)) & (buckets > 0)).argmax())
    xstep = int(np.ceil(((bins[(- 1)] - bins[xmin_idx]) / 10)))
    plt.xticks(bins[xmin_idx::xstep], [('$2^{%d}$' % xl) for xl in bins[xmin_idx::xstep]])
    plt.xlim([(bins[xmin_idx] - xstep), (bins[(- 1)] + xstep)])
    if log:
        ymax = (np.ceil(buckets.max()) + 1)
        ystep = np.ceil((ymax / 5))
        plt.yticks(np.arange(0, (ymax + ystep), ystep), [('$2^{%d}$' % yl) for yl in np.arange(0, (ymax + ystep), ystep)])
        plt.ylim([0, (ymax + 1)])
    plt.tight_layout()
    plt.show()
Plot relative distances from points found by fiber traversal or baseline.
test_ids, Ns, and samp_range should be as in show_traverse_re_fig.
def show_simple_rd_all_fig(test_data_ids, Ns, samp_range):
    '\n    Plot relative distances from points found by fiber traversal or baseline.\n    test_ids, Ns, and samp_range should be as in show_traverse_re_fig.\n    '
    log = True
    mpl.rcParams['mathtext.default'] = 'regular'
    mpl.rcParams['pdf.fonttype'] = 42
    mpl.rcParams['ps.fonttype'] = 42
    buckets = None
    bins = None
    for samp in samp_range:
        for (test_data_id, N) in zip(test_data_ids, Ns):
            print(('samp %d, N %d' % (samp, N)))
            npz = np.load(('results/simple_rd_%s_N_%d_s_%d.npz' % (test_data_id, N, samp)))
            if (buckets is None):
                buckets = np.zeros(npz['traverse_buckets'].shape)
                bins = npz['bins']
            buckets += npz['traverse_buckets']
            buckets += npz['baseline_buckets']
    plt.figure(figsize=(8, 2.4))
    if log:
        buckets[(buckets > 0)] = np.log2(buckets[(buckets > 0)])
    plt.bar(left=bins[:(- 1)], height=buckets, width=(bins[1:] - bins[:(- 1)]), facecolor='none')
    plt.ylabel('# of pairs')
    plt.xlabel('$max_i|v_i^{(1)}-v_i^{(2)}|$')
    xmin_idx = int(((bins[:(- 1)] > (- 1000)) & (buckets > 0)).argmax())
    xstep = int(np.ceil(((bins[(- 1)] - bins[xmin_idx]) / 10)))
    plt.xticks(bins[xmin_idx::xstep], [('$2^{%d}$' % xl) for xl in bins[xmin_idx::xstep]])
    plt.xlim([(bins[xmin_idx] - xstep), (bins[(- 1)] + xstep)])
    if log:
        ymax = (np.ceil(buckets.max()) + 1)
        ystep = np.ceil((ymax / 5))
        plt.yticks(np.arange(0, (ymax + ystep), ystep), [('$2^{%d}$' % yl) for yl in np.arange(0, (ymax + ystep), ystep)])
        plt.ylim([0, (ymax + 1)])
    plt.tight_layout()
    plt.show()