def transform(nodes, fxn, *args, **kwargs):
    """
    Apply an arbitrary function to an array of node coordinates.

    Parameters
    ----------
    nodes : numpy.ndarray
        An N x M array of individual node coordinates (i.e., the
        x-coords or the y-coords only)
    fxn : callable
        The transformation to be applied to the whole ``nodes`` array
    args, kwargs
        Additional positional and keyword arguments that are passed to
        ``fxn``. The final call will be ``fxn(nodes, *args, **kwargs)``.

    Returns
    -------
    transformed : numpy.ndarray
        The transformed array.

    """

    return fxn(nodes, *args, **kwargs)