yihui / animation

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

'ani.res' option is ignored if 'ani.dev' is 'agg_png' #134

Closed trevorld closed 3 years ago

trevorld commented 3 years ago

I'll be making a Pull Request that fixes this.

library("animation")
library("grid")
library("ragg")

grob <- rectGrob(x = unit(1.5, "in"), width = unit(1.0, "in"), 
                 gp = gpar(fill = "blue", col = NA))

# right half should be blue but isn't
saveGIF(grid.draw(grob), ani.height = 200, ani.width = 200, ani.res = 100,
        ani.dev = 'agg_png')

agg_png("example.png", width = 200, height = 200, res = 100)
grid.draw(grob)
dev.off()