Home > database >  How to change the resolution of animated plots (gif) in RStudio Viewer?
How to change the resolution of animated plots (gif) in RStudio Viewer?

Time:01-26

I'm currently following Output in the RStudio Viewer

Appearance of the same animated plot from the website: Example from the gganimate tutorial

Code from the website to create the above animated plot:

library(gganimate)
p <- ggplot(iris, aes(x = Petal.Width, y = Petal.Length))   
  geom_point()
anim <- p   
  transition_states(Species,
                    transition_length = 2,
                    state_length = 1)
anim

CodePudding user response:

I guess those plots shown in the gganimate article were created on a Linux platform. gganimate by default uses the 'png' device for rendering the single frames.

png() on windows however by default uses the result

In this context also check this article, library(ragg) and setting animate's parameter device = 'ragg_png'.

  •  Tags:  
  • Related