def loss_surface_mesh(x, y, f):
    """
    Takes irregularly spaced points ``(x, y, f)`` and creates a mesh using
    the ``Mayavi`` package and Delaunay triangulation.

    This method is useful to visualize the output of an optimisation routine on
    a 2-dimensional parameter space.

    *Note: this method requires Mayavi to be installed.*
    """
    from mayavi import mlab
    mlab.figure(1, fgcolor=(0, 0, 0), bgcolor=(1, 1, 1))
    p = mlab.points3d(x, y, f, f, scale_mode='none', scale_factor=0)
    mlab.pipeline.surface(mlab.pipeline.delaunay2d(p))
    mlab.show()
