A wrapper for ggplot2::stat_function()
umxPlotFun(
fun = dnorm,
min = -1,
max = 5,
xlab = NULL,
ylab = NULL,
title = NULL,
p = NULL
)
Function to plot. Also takes strings like "sin(x) + sqrt(1/x)"
x-range min
x-range max
= Optional x axis label
= Optional y axis label
Optional title for the plot
Optional plot onto which to draw the function.
A ggplot graph
Easily plot a function - like sin, using ggplot.
Other Plotting functions:
plot.MxLISRELModel()
,
plot.MxModelTwinMaker()
,
plot.MxModel()
,
umxPlotACEcov()
,
umxPlotACEv()
,
umxPlotACE()
,
umxPlotCP()
,
umxPlotDoC()
,
umxPlotGxEbiv()
,
umxPlotGxE()
,
umxPlotIP()
,
umxPlotSexLim()
,
umxPlotSimplex()
,
umx
# 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))
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab