anim.smooth {anim.plots} | R Documentation |
Smooth an anim.frames
object
Description
Some export formats ignore information in the times
attribute and plot frames at constant speed. anim.smooth
creates
a smoothed version of the anim.frames
object with frames at
constant intervals, suitable for export.
Usage
anim.smooth(x, fps = 10)
Arguments
x |
an |
fps |
how many frames per second to smooth to |
Details
Note that plot parameters such as x and y positions are not interpolated.
If you want your whole animation to look smoother, you have to do
the work yourself using e.g.approx
.
If you smooth to a large value of fps
, the animations may look bad
in R because they overtax the graphics engine. They should still look good
when saved, though.
Value
A smoothed anim.frames
object, with the speed
attribute equal
to fps
.
Examples
accel <- anim.plot(1, 1:30, times=sqrt(1:30))
## Not run:
anim.save(accel, "GIF", "wrong.gif")
## End(Not run)
accel <- anim.smooth(accel, fps=20)
## Not run:
anim.save(accel, "GIF", "better.gif")
## End(Not run)
[Package anim.plots version 0.2.2 Index]