def METHOD_NAME(bins, enrichment_BA, enrichment_AA, enclosed_BA, enclosed_AA, enclosed_area, pearson=None, MA=None,
                                 MB=None, nameA='A', nameB = 'B'):
    import matplotlib.pyplot as plt
    import scipy.interpolate
    #find the distance at which 50% of the labelling is included
    d_50 = float(scipy.interpolate.interp1d(enclosed_BA, bins[1:])(.5))
    f = plt.figure()
    if not pearson is None:
        plt.figtext(.1, .95, 'Pearson: %2.2f   M1: %2.2f M2: %2.2f' % (pearson, MA, MB))
    plt.subplot(211)
    plt.plot(bins[1:], enrichment_BA, lw=2, drawstyle='steps')
    if not enrichment_AA is None:
        plt.plot(bins[1:], enrichment_AA, 'k--', drawstyle='steps')#, binsA[1] - binsA[0])
    plt.xlabel('Distance from edge of %s [nm]' % nameA)
    plt.ylabel('Relative enrichment')# % nameB)
    plt.plot([bins[0], bins[-1]], [1, 1], 'k:')
    plt.grid()
    plt.xlim([bins[0], bins[-1]])
    plt.legend([nameB, nameA + ' (control)', 'uniform'], fontsize='medium', frameon=False)
    plt.subplot(212)
    plt.plot(bins[1:], enclosed_BA, lw=2)
    if not enclosed_AA is None:
        plt.plot(bins[1:], enclosed_AA, 'k--')
    plt.plot(bins[1:], enclosed_area, 'k:')
    plt.plot([bins[0], d_50], [.5, .5], 'r:')
    plt.plot([d_50, d_50], [0, .5], 'r:')
    plt.text(d_50 + 150, .45, '50%% of %s is within %d nm' % (nameB, d_50))
    plt.xlabel('Distance from edge of %s [nm]' % nameA)
    plt.ylabel('Fraction of %s enclosed' % nameB)
    plt.grid()
    plt.xlim([bins[0], bins[-1]])
    return f