Home Comments Thread

5 Replies

giscus-bot giscus-bot 3y ago
Guest *DWSWesVirginny* @ 2019-10-05 13:02:49 originally posted:

Can you use this with ggplot2?

giscus-bot giscus-bot 3y ago
Guest *Romain B* @ 2019-10-14 11:59:36 originally posted:

See this tutorial.

Or this one.

giscus-bot giscus-bot 3y ago
Guest *Ariel Fuentes* @ 2020-06-11 17:31:34 originally posted:

How can change the saving folder? movie.name = "subfolder/animation.gif" doesn't work.

giscus-bot giscus-bot 3y ago
Guest *anonymous* @ 2020-11-30 12:50:29 originally posted:

Yihui, how do we think about the upper limit of how many frames we can stitch together with saveGIF() ? Take the code below for example:

nframes<-1000
saveGIF({
for (i in 1:nframes) plot(runif(10), ylim = 0:1)
})

I can get it to work for nframes = 300 but not for nframes=400 or anything bigger. Somewhere between 300 and 400 is its apparent limit. As I understand it ImageMagick's limit is close to 10,000, so that does not appear to be the binding constraint. Is there a solution to it? Or is there another way to save the video (other than saveGIF) that would allow stitching of more frames?

yihui yihui 3y ago

I just ran your code, and I was able to get a GIF with 1000 frames. I'm not sure what the problem could be in your case. Sorry.

Originally posted on 2020-11-30 16:54:55

giscus-bot giscus-bot 3y ago
Guest *anonymous* @ 2020-11-30 22:11:33 originally posted:

This is great news that it does/should work for as many as 1000 frames. It is also helpful to know that the problem is on my end. I'll look into why my code crashes with more than 300 frames. Thank you for your help.

giscus-bot giscus-bot 3y ago
Guest *anonymous* @ 2020-12-01 01:28:19 originally posted:

Yihui, I went through your example - demo('rgl_animation') - which saves a sequence of png frames of rgl scenes (created with rgl.snapshot) as a Latex document. I am wondering if these rgl scenes could instead be saved as a video file with saveGIF() perhaps. Is it possible? Or pehaps more broadly, how could I stitch the (rgl scenes) frames below into a video using the animation package?

for (i in 1:10) {
with(iris, plot3d(x=Sepal.Length[i], y=Sepal.Width[i], z=Petal.Length[i], type="s", col=as.numeric(Species)))
}

Thank you.

yihui yihui 3y ago

Hi, I recommend that you ask such questions on Stack Overflow or RStudio Community. I really don't have enough time to answer questions here on a 1:1 basis. Thank you!

Originally posted on 2020-12-01 04:02:18

chuxinyuan chuxinyuan 7mo ago

最后一个示例我这里会报错,报错日志如下:

错误于if (100%%fps) stop("argument 'fps' must be a factor of 100"): 
  the condition has length > 1
animation option 'nmax' changed: 30 --> 50

我的系统环境:

xfun::session_info("animation")
#> R version 4.5.1 (2025-06-13)
#> Platform: x86_64-pc-linux-gnu
#> Running under: Arch Linux
#> 
#> Locale:
#>   LC_CTYPE=zh_CN.UTF-8       LC_NUMERIC=C              
#>   LC_TIME=zh_CN.UTF-8        LC_COLLATE=zh_CN.UTF-8    
#>   LC_MONETARY=zh_CN.UTF-8    LC_MESSAGES=zh_CN.UTF-8   
#>   LC_PAPER=zh_CN.UTF-8       LC_NAME=C                 
#>   LC_ADDRESS=C               LC_TELEPHONE=C            
#>   LC_MEASUREMENT=zh_CN.UTF-8 LC_IDENTIFICATION=C       
#> 
#> Package version:
#>   animation_2.7   curl_6.4.0      graphics_4.5.1  grDevices_4.5.1
#>   magick_2.8.7    magrittr_2.0.3  methods_4.5.1   Rcpp_1.1.0     
#>   stats_4.5.1     utils_4.5.1

Created on 2025-07-06 with reprex v2.1.1

Sign in to join the discussion

Sign in with GitHub