stat_function {ggplot2} | R Documentation |
Superimpose a function
stat_function(mapping=NULL, data=NULL, geom="path", position="identity", fun, n=101, args=list(), ...)
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 |
This page describes stat_function, see layer
and qplot
for how to create a complete plot from individual components.
A layer
Hadley Wickham, http://had.co.nz/
## Not run: x <- rnorm(100) qplot(x, geom="density") + stat_function(fun = dnorm, colour="red") ## End(Not run)