plotnine.stat_function

stat_function(mapping=None, data=None, **kwargs)

Superimpose a function onto a plot

{usage}

Parameters

fun : callable

Function to evaluate.

n : int = 101

Number of points at which to evaluate the function.

xlim : tuple = None

x limits for the range. The default depends on the x aesthetic. There is not an x aesthetic then the xlim must be provided.

args : Optional[tuple[Any] | dict[str, Any]] = None

Arguments to pass to fun.

See Also

geom_path

The default geom for this stat.