From simon.urbanek at r-project.org  Tue Feb 15 23:05:54 2011
From: simon.urbanek at r-project.org (Simon Urbanek)
Date: Tue, 15 Feb 2011 17:05:54 -0500
Subject: [Rd] Using rasterImage on a CairoWin device prevents adding
	further elements to device?
In-Reply-To: <AANLkTikng2NZ0doG0W-ZXLjr-JEmV6sQ=bv28eR2REyw@mail.gmail.com>
References: <AANLkTikng2NZ0doG0W-ZXLjr-JEmV6sQ=bv28eR2REyw@mail.gmail.com>
Message-ID: <E4359DF4-52EF-426E-95A5-9A21747830A6@r-project.org>

Joris,

I have added raster support only recently (last week ;)) and there was a bug causing what you see. I have fixed it now so Cairo 1.4-7 will have the fix.

Thanks,
Simon


On Feb 15, 2011, at 9:48 AM, Joris Meys wrote:

> 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
> 
> 



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