stat_function {ggplot2}R Documentation

stat_function

Description

Superimpose a function

Usage

stat_function(mapping=NULL, data=NULL, geom="path", position="identity", fun, n=101, args=list(), ...)

Arguments

mapping mapping between variables and aesthetics generated by aes
data dataset used in this layer, if not specified uses plot dataset
geom geometric used by this layer
position position adjustment used by this layer
fun function to use
n number of points to interpolate along
args list of additional arguments to pass to fun
... other arguments

Details

This page describes stat_function, see layer and qplot for how to create a complete plot from individual components.

Value

A layer

Author(s)

Hadley Wickham, http://had.co.nz/

See Also

Examples

## Not run: 
x <- rnorm(100)
qplot(x, geom="density") + stat_function(fun = dnorm, colour="red")
## End(Not run)

[Package ggplot2 version 0.8.2 Index]