Stemify a curve (x, y). This is useful for filling histograms manually.

def stemify(x, y):

    """
    Stemify a curve (x, y). This is useful for filling histograms manually.
    """

    xx = numpy.zeros(3 * len(x), dtype=float)
    yy = numpy.zeros(3 * len(y), dtype=float)
    xx[0::3], xx[1::3], xx[2::3] = x, x, x
    yy[1::3] = y
    return xx, yy