| umxPlotFun | R Documentation |
A wrapper for ggplot2::stat_function() that handles single or multiple functions.
umxPlotFun(
fun = c("sin(x)", "cos(x)"),
min = -1,
max = 5,
xlab = NULL,
ylab = NULL,
title = NULL,
logY = c("no", "log", "log10"),
logX = c("no", "log", "log10"),
p = NULL
)
fun |
Function(s) to plot. Takes strings like c("3 + sin(x)^2", "cos(x)") or function objects. |
min |
x-range min. |
max |
x-range max. |
xlab |
Optional x axis label. |
ylab |
Optional y axis label. |
title |
Optional title for the plot. |
logY |
Set to "log" or "log10" to transform y coordinate. |
logX |
Set to "log" or "log10" to transform x coordinate. |
p |
Optional plot onto which to draw the function(s). |
Easily plot functions—like sin or x^2—using ggplot. Accepts bare functions, strings, or lists of strings/functions. Automatically generates a legend when multiple functions are provided.
A ggplot graph object
ggplot2::stat_function()
Other Plotting functions:
ggAddR(),
plot.MxLISRELModel(),
plot.MxModel(),
plot.MxModelTwinMaker(),
umx,
umxPlot(),
umxPlotACE(),
umxPlotACEcov(),
umxPlotACEv(),
umxPlotCP(),
umxPlotDoC(),
umxPlotGxE(),
umxPlotGxEbiv(),
umxPlotIP(),
umxPlotPredict(),
umxPlotSexLim(),
umxPlotSimplex()
## Not run:
# Plotting multiple strings
p = umxPlotFun(c("sin(x)", "cos(x)"), max = 2*pi)
# Providing a named list to control legend labels
umxPlotFun(list(Sine = sin, Cosine = cos), max = 2*pi)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.