def METHOD_NAME(read_entropy_file: typing.IO) -> plt.Figure:
    plots = []
    fig, ax1 = plt.subplots()
    # noinspection PyTypeChecker
    merge_entropy = np.genfromtxt(read_entropy_file,
                                  delimiter=',',
                                  names=True,
                                  dtype=float)
    merge_lengths = merge_entropy['merge_length'].astype(int)
    merge_counts = merge_entropy['count'].astype(int)
    plt.title('Count of merged reads at each length')
    ax1.set_ylabel('merged read count')
    ax1.set_xlabel('length of merged reads')
    if not merge_lengths.size:
        ax1.text(0.5,
                 0.5,
                 'No merged reads.',
                 transform=ax1.transAxes,
                 fontsize=14,
                 verticalalignment='center',
                 horizontalalignment='center',
                 bbox=dict(boxstyle='round',
                           facecolor='wheat',
                           alpha=0.5))
        return fig
    plots.append(ax1.bar(merge_lengths,
                         merge_counts,
                         width=1.0,
                         label='merged read count'))
    ax2 = ax1.twinx()
    plots.append(ax2.plot(merge_entropy['merge_length'],
                          merge_entropy['entropy'],
                          'r',
                          label='entropy')[0])
    max_length = merge_lengths.max()
    min_buffer = 3
    max_buffer = 7
    length_counts = np.zeros(max_length + 1)
    length_counts[merge_lengths] = merge_counts
    buffered_length_counts = np.zeros(max_length + 1 + 2*max_buffer)
    buffered_length_counts[max_buffer:-max_buffer] = length_counts
    for buffer_size in range(min_buffer, max_buffer+1):
        averages = np.zeros(max_length+1)
        for neighbour_offset in range(-buffer_size, buffer_size+1):
            if neighbour_offset:
                start_index = max_buffer + neighbour_offset
                averages += buffered_length_counts[
                            start_index:start_index+max_length+1]
        averages /= buffer_size * 2
        # noinspection PyArgumentList
        ratios = np.divide(length_counts,
                           averages,
                           out=np.zeros_like(length_counts),
                           where=averages != 0)
        ratios[ratios < 1.0] = np.nan
        # plots.extend(ax2.plot(ratios,
        #                       'o',
        #                       alpha=0.3,
        #                       label=f'+/-{buffer_size} nbrs'))
    ax2.set_ylabel('entropy level')
    ax2.set_ylim(0)
    plt.legend(plots, [p.get_label() for p in plots])
    return fig