def _xyplot_base(plot_function, coordinate_pairs, *args, **kwds):
    """A wrapper around <function> based on coordinate pairs
       instead of x and y lists.
       Optionally takes keyword "swapxy" to swap x and y."""
    swapxy = kwds.pop('swapxy', False)
    x, y = zip(*coordinate_pairs)
    if swapxy:
        x, y = y, x
    return plot_function(x, y, *args, **kwds)
