anim.curve {anim.plots} | R Documentation |
Draw an animated curve.
Description
This function is the animated version of curve
.
Usage
anim.curve(expr, x = NULL, from = 0, to = 1, n = 255, times, type = "l", ...)
Arguments
expr |
a function which takes two arguments, or an expression involving
|
x |
values of |
from , to |
endpoints of |
n |
number of values of |
times |
vector of values of |
type , ... |
parameters passed to |
Details
Note that times
is interpreted differently here than elsewhere. In
particular, it cannot be a length-1 vector.
Examples
anim.curve(x^t, times=10:50/10, n=20)
anim.curve(sin(x*t), times=1:30, n=100, speed=12, col="darkgreen", from=-1, to=1)
## curve is constant in t, but window moves.
## NB: 'from' and 'to' control where the expression is evaluated.
## 'xlim' just controls the window.
anim.curve(sin(cos(-x)*exp(x/2)), times=0:100/10, from=-5, to=10, n=500,
col="red", lwd=2, xlim=rbind(top <- seq(-5, 10, 1/10), top+5))
[Package anim.plots version 0.2.2 Index]