# Buggy code
def _draw_2d_from_bounds(draw_method_name, cube, *args, **kwargs):
    # NB. In the interests of clarity we use "u" and "v" to refer to the
    # horizontal and vertical axes on the matplotlib plot.

    # get & remove the coords entry from kwargs
    coords = kwargs.pop("coords", None)
    mode = iris.coords.BOUND_MODE
    if coords is not None:
        plot_defn = _get_plot_defn_custom_coords_picked(cube, coords, mode)
    else:
        plot_defn = _get_plot_defn(cube, mode, ndims=2)

    data = cube.data
    if plot_defn.transpose:
        data = data.T

    if _can_draw_map(plot_defn.coords):
        result = _map_common(
            draw_method_name, None, iris.coords.BOUND_MODE, cube, data, *args, **kwargs
        )
    else:
        # Obtain U and V coordinates
        v_coord, u_coord = plot_defn.coords

        # XXX: Watch out for non-contiguous bounds.
        if u_coord:
            u = u_coord.contiguous_bounds()
        else:
            u = np.arange(data.shape[1] + 1)
        if v_coord:
            v = v_coord.contiguous_bounds()
        else:
            v = np.arange(data.shape[0] + 1)

        if plot_defn.transpose:
            u = u.T
            v = v.T

        u, v = _broadcast_2d(u, v)

        draw_method = getattr(plt, draw_method_name)
        result = draw_method(u, v, data, *args, **kwargs)

    return result


# Traceback (iris.exceptions.CoordinateNotFoundError)
Traceback (most recent call last):
File "/net/home/h05/cpelley/Remedy/GITHUB/no_pass_coords.py", line 28, in <module>
iplt.contourf(cube)
File "/home/h05/cpelley/git/iris/lib/iris/plot.py", line 464, in contourf
result = _draw_2d_from_points('contourf', None, cube, *args, **kwargs)
File "/home/h05/cpelley/git/iris/lib/iris/plot.py", line 261, in _draw_2d_from_points
*args, **kwargs)
File "/home/h05/cpelley/git/iris/lib/iris/plot.py", line 373, in _map_common
x, y = cartography.get_xy_grids(cube)
File "/home/h05/cpelley/git/iris/lib/iris/analysis/cartography.py", line 190, in get_xy_grids
x_coord, y_coord = cube.coord(axis="X"), cube.coord(axis="Y")
File "/home/h05/cpelley/git/iris/lib/iris/cube.py", line 1041, in coord
raise iris.exceptions.CoordinateNotFoundError(msg)
iris.exceptions.CoordinateNotFoundError: u'Expected to find exactly 1 coordinate, but found 2. They were: grid_longitude, longitude.'

# Fixed code
def _draw_2d_from_bounds(draw_method_name, cube, *args, **kwargs):
    # NB. In the interests of clarity we use "u" and "v" to refer to the
    # horizontal and vertical axes on the matplotlib plot.
    mode = iris.coords.BOUND_MODE
    # Get & remove the coords entry from kwargs.
    coords = kwargs.pop("coords", None)
    if coords is not None:
        plot_defn = _get_plot_defn_custom_coords_picked(cube, coords, mode)
    else:
        plot_defn = _get_plot_defn(cube, mode, ndims=2)

    if _can_draw_map(plot_defn.coords):
        result = _map_common(
            draw_method_name,
            None,
            iris.coords.BOUND_MODE,
            cube,
            plot_defn,
            *args,
            **kwargs,
        )
    else:
        # Obtain data array.
        data = cube.data
        if plot_defn.transpose:
            data = data.T

        # Obtain U and V coordinates
        v_coord, u_coord = plot_defn.coords

        # XXX: Watch out for non-contiguous bounds.
        if u_coord:
            u = u_coord.contiguous_bounds()
        else:
            u = np.arange(data.shape[1] + 1)
        if v_coord:
            v = v_coord.contiguous_bounds()
        else:
            v = np.arange(data.shape[0] + 1)

        if plot_defn.transpose:
            u = u.T
            v = v.T

        u, v = _broadcast_2d(u, v)
        draw_method = getattr(plt, draw_method_name)
        result = draw_method(u, v, data, *args, **kwargs)

    return result