def METHOD_NAME(plot, edges, histograms, colors, legend):
    # check that we have the same number of histogram, color and baseline
    current_baseline = numpy.zeros_like(edges)
    for histogram, color, layer_index in zip(histograms, colors, range(len(colors))):
        stacked_histo = histogram + current_baseline
        plot.addHistogram(histogram=stacked_histo,
                          edges=edges,
                          legend='_'.join((legend, str(layer_index))),
                          color=color,
                          baseline=current_baseline,
                          z=len(histograms)-layer_index,
                          fill=True)
        current_baseline = stacked_histo