umxPlotFun | R Documentation |
A wrapper for ggplot2::stat_function()
umxPlotFun(
fun = c(dnorm, "sin(x) + sqrt(1/x)"),
min = -1,
max = 5,
xlab = NULL,
ylab = NULL,
title = NULL,
logY = c("no", "log", "log10"),
p = NULL
)
fun |
Function to plot. Also takes strings like "sin(x) + sqrt(1/x)". |
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, e.g. "log" to set COORDINATE of y to log. |
p |
Optional plot onto which to draw the function. |
Easily plot a function - like sin, using ggplot.
A ggplot graph
ggplot2::stat_function()
Other Plotting functions:
ggAddR()
,
plot.MxLISRELModel()
,
plot.MxModel()
,
plot.MxModelTwinMaker()
,
umx
,
umxPlot()
,
umxPlotACE()
,
umxPlotACEcov()
,
umxPlotACEv()
,
umxPlotCP()
,
umxPlotDoC()
,
umxPlotGxE()
,
umxPlotGxEbiv()
,
umxPlotIP()
,
umxPlotSexLim()
,
umxPlotSimplex()
## Not run:
# Uses fonts not available on CRAN
umxPlotFun(sin, max= 2*pi)
umxPlotFun("sqrt(1/x)", max= 2*pi)
umxPlotFun(sin, max= 2*pi, ylab="Output of sin", title="My Big Graph")
p = umxPlotFun(function(x){x^2}, max= 100, title="Supply and demand")
umxPlotFun(function(x){100^2-x^2}, p = p)
# Controlling other plot features
umxPlotFun(c("sin(x)", "x^3")) + ylim(c(-1,5))
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.