def _fix_coords(x, y):
    """
    Ensure longitudes are monotonic and make `~numpy.ndarray` copies so the
    contents can be modified. Ignores 2D coordinate arrays.
    """
    if x.ndim != 1 or all(x < x[0]):  # skip 2D arrays and monotonic backwards data
        return x, y
    lon1 = x[0]
    filter_ = x < lon1
    while filter_.sum():
        filter_ = x < lon1
        x[filter_] += 360
    return x, y