def histogram(values, bins=10, vrange=None, title="", c="g", corner=1, lines=True):
    """
    Build a 2D histogram from a list of values in n bins.

    Use *vrange* to restrict the range of the histogram.

    Use *corner* to assign its position:
        - 1, topleft,
        - 2, topright,
        - 3, bottomleft,
        - 4, bottomright.

    .. hint:: Example: |fitplanes.py|_
    """
    fs, edges = np.histogram(values, bins=bins, range=vrange)
    pts = []
    for i in range(len(fs)):
        pts.append([(edges[i] + edges[i + 1]) / 2, fs[i]])
    return xyplot(pts, title, c, corner, lines)