def manipulate_shown_data(f, input_axes="gca", output_axes=None, fxname=1, fyname=1, clear=1, pause=False, **kwargs):
    """
    Loops over the visible data on the specified axes and modifies it based on
    the function f(xdata, ydata), which must return new_xdata, new_ydata

    input_axes  which axes to pull the data from
    output_axes which axes to dump the manipulated data (None for new figure)

    fxname      the name of the function on x
    fyname      the name of the function on y
                1 means "use f.__name__"
                0 or None means no change.
                otherwise specify a string

    **kwargs are sent to axes.plot
    """

    # get the axes
    if input_axes == "gca": a1 = _pylab.gca()
    else:                   a1 = input_axes



    # get the xlimits
    xmin, xmax = a1.get_xlim()

    # get the name to stick on the x and y labels
    if fxname==1: fxname = f.__name__
    if fyname==1: fyname = f.__name__

    # get the output axes
    if output_axes == None:
        _pylab.figure(a1.figure.number+1)
        a2 = _pylab.axes()
    else:
        a2 = output_axes

    if clear: a2.clear()

    # loop over the data
    for line in a1.get_lines():

        # if it's a line, do the manipulation
        if isinstance(line, _mpl.lines.Line2D):

            # get the data
            x, y = line.get_data()

            # trim the data according to the current zoom level
            x, y = _fun.trim_data(xmin, xmax, x, y)

            # do the manipulation
            new_x, new_y = f(x,y)

            # plot the new
            _s.plot.xy.data(new_x, new_y, clear=0, label=line.get_label().replace("_", "-"), axes=a2, **kwargs)

            # pause after each curve if we're supposed to
            if pause:
                _pylab.draw()
                input("<enter> ")

    # set the labels and title.
    if fxname in [0,None]:  a2.set_xlabel(a1.get_xlabel())
    else:                   a2.set_xlabel(fxname+"("+a1.get_xlabel()+")")

    if fyname in [0,None]:  a2.set_ylabel(a1.get_ylabel())
    else:                   a2.set_ylabel(fyname+"("+a1.get_ylabel()+")")

    _pylab.draw()
Loops over the visible data on the specified axes and modifies it based on
    the function f(xdata, ydata), which must return new_xdata, new_ydata

    input_axes  which axes to pull the data from
    output_axes which axes to dump the manipulated data (None for new figure)

    fxname      the name of the function on x
    fyname      the name of the function on y
                1 means "use f.__name__"
                0 or None means no change.
                otherwise specify a string

    **kwargs are sent to axes.plot