[Rd] Using rasterImage on a CairoWin device prevents adding further elements to device?

Joris Meys jorismeys at gmail.com
Tue Feb 15 15:48:06 CET 2011


I was pointed to the Cairo package for plotting PNG images on a
device. I've been playing around with it, but found that after I use
the rasterImage function, I can't add anything any more to the device,
eg :

img <- readPNG(system.file("img", "Rlogo.png", package="png"))
r = as.raster(img[,,1:3])
r[img[,,4] == 0] = "white"

CairoWin()
plot(1:2,1:2,type="l")
rasterImage(r,1,1,2,2)
points(seq(1,2,by=0.1),seq(2,1,by=-0.1),col="black")

The points are not plotted anymore.

If I use the normal plotting device, I see the points plotted on top
of the image.

Cheers
Joris


-- 
Joris Meys
Statistical consultant

Ghent University
Faculty of Bioscience Engineering
Department of Applied mathematics, biometrics and process control

tel : +32 9 264 59 87
Joris.Meys at Ugent.be
-------------------------------
Disclaimer : http://helpdesk.ugent.be/e-maildisclaimer.php



More information about the R-devel mailing list