yihui / animation

A gallery of animations in statistics and utilities to create animations
https://yihui.org/animation/
206 stars 60 forks source link

'R animation' displaying only static image instead of animation #116

Closed mallick84 closed 6 years ago

mallick84 commented 6 years ago

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.

yulijia commented 6 years ago

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.

mallick84 commented 6 years ago

@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.

yulijia commented 6 years ago

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.

yihui commented 6 years ago

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!

mallick84 commented 6 years ago

@yihui thank it. it is working now