yihui / animation

A gallery of animations in statistics and utilities to create animations

Home Page:https://yihui.org/animation/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

'R animation' displaying only static image instead of animation

mallick84 opened this issue · comments

I am new to R animation package. I have installed ImageMagick version 7.0.7-Q16. I am working in RStudio in a Windows 7 64-bit environment.

While I am trying to code my first animation with simpler one.

Below code:

ani.options(convert = 'C:\Program Files\ImageMagick-7.0.7-Q16\convert.exe')
saveGIF({
for (i in 1:10) plot(runif(10), ylim = 0:1)
})
Here I am getting the following result:

Output at: animation.gif
[1] TRUE
I have also tried this same code in other way i.e. I have replaced convert.exe with magick.exe:

ani.options(convert=shortPathName("C:\Program Files\ImageMagick-7.0.7-Q16\magick.exe"))
saveGIF({
for (i in 1:10) plot(runif(10), ylim = 0:1)
})
Here I am getting same output. i.e.

Output at: animation.gif
[1] TRUE
Question:

In both case, it is displaying only the Image on the screen. The animation is not running. Am I missing something? please suggest me.

Could you make sure that you can open gif image by a correct photo viewer, I know windows Photo viewer cannot show animation, you need to try open gif using any browser like chrome, firefox.

For the code you have shown above, it doesn't provide enough information to reproduce your problem.

@yulijia ,Thank you for your response. Yes, it is showing in Picasa photo viewer. By default, it is viewing in Picasa photo viewer.
Since I am new to your animation package, I have just copy pest your given code. In the R console I am getting the below code and with this only static image is displaying in Picasa photo viewer.

test

"Output at: animation.gif
[1] TRUE"

Any further information required? please convey me. otherwise, you can suggest me to run some given code example.

Thank you.

Please change your photo viewer, there is no problem with your code and animation package. I can see your gif animation posted above, I don't have any other suggestion.

For the record, this was cross-posted at https://stackoverflow.com/q/50712492/559676. When you cross-post issues, please mention it. Let's keep everyone in the same thread. Thanks!

@yihui thank it. it is working now