[Rd] strange interaction between rasterImage and Grid graphics

Deepayan Sarkar deepayan.sarkar at gmail.com
Sat Oct 2 09:33:59 CEST 2010


On Fri, Oct 1, 2010 at 12:17 AM, baptiste auguie
<baptiste.auguie at googlemail.com> wrote:
> Dear all,
>
> This may be specific to Mac, I haven't had a chance to test another
> platform. Consider this,
>
> plot(1,1,t="n")
> rasterImage(matrix(1),1,1,1,1)
> library(grid)
> grid.rect(gp=gpar(fill="grey"))
>
> The grid.rect covers the full device window as expected. However, when
> I resize the window ever so slightly (interactive device) the rectGrob
> is suddenly clipped to the previous plot window. I cannot understand
> this behavior, and it doesn't happen if one removes the rasterImage()
> call, so I suspect something iffy is going on with the display list or
> something.

I can reproduce the behaviour on GNU/Linux x11(type="cairo"), but this
is inappropriate mixing of base and grid graphics, so officially I
don't think you are allowed to expect anything at all.

-Deepayan


>
> The only device I've tried is quartz(), x11() crashed with rasterImage,
>
>  *** caught segfault ***
> address 0x28, cause 'memory not mapped'
>
> Traceback:
>  1: rasterImage(matrix(1), 1, 1, 1, 1)
>
> sessionInfo()
> R version 2.11.1 (2010-05-31)
> x86_64-apple-darwin9.8.0
>
> locale:
> [1] en_GB.UTF-8/en_GB.UTF-8/C/C/en_GB.UTF-8/en_GB.UTF-8
>
> attached base packages:
> [1] grid      stats     graphics  grDevices utils     datasets  methods   base
>
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>



More information about the R-devel mailing list