demo/use_Cairo.R

## use the (high-quality) Cairo device

library(animation)
library(Cairo)

saveHTML({
  ani.options(interval = 0.05, nmax = 1)
  
  CairoPNG(filename = ani.options('img.fmt'))
  
  par(pty = 's', mar = rep(1, 4))
  vi.lilac.chaser()
  
  dev.off()
}, img.name='chaser_cairo', htmlfile='chaser.html',
         use.dev=FALSE, ani.type='png',
         description = 'Using the high-quality CairoPNG() device')


saveHTML({
  ani.options(interval = 0.05, nmax = 1)
  
  par(pty = 's', mar = rep(1, 4))
  vi.lilac.chaser()
  
}, img.name='chaser_png', htmlfile='chaser.html',
         use.dev=TRUE, ani.dev='png', ani.type='png',
         description = c("Using R's png() device; can you see the difference?",
                         'Note the borders of the dots.'))

Try the animation package in your browser

Any scripts or data that you put into this service are public.

animation documentation built on Oct. 7, 2021, 9:18 a.m.