File: use_Cairo.R

package info (click to toggle)
r-cran-animation 2.7%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 1,268 kB
  • sloc: javascript: 873; sh: 15; makefile: 2
file content (29 lines) | stat: -rw-r--r-- 764 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
## 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.'))