[R-sig-Geo] rasterImage support in R > 2.11.0 (problem for Windows in SDI mode)

Renaud Lancelot renaud.lancelot at gmail.com
Tue Jul 20 15:26:04 CEST 2010


Thank you for this information. I was able to reproduce the problem
even after the first dev.off().

> sessionInfo()
R version 2.11.1 Patched (2010-06-08 r52227)
i386-pc-mingw32

locale:
[1] LC_COLLATE=French_France.1252  LC_CTYPE=French_France.1252
LC_MONETARY=French_France.1252 LC_NUMERIC=C
[5] LC_TIME=French_France.1252

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

other attached packages:
[1] fortunes_1.3-7

Cheers,

Renaud

2010/7/20 Michael Sumner <mdsumner at gmail.com>:
> Hello, this is just a note for new raster plotting support - and only
> affects users of R for Windows in SDI mode (window application mode-
> which is not the default install option).  It affects both 32- and
> 64-bit R on Windows.
>
> The behaviour is a bit weird and subtle, so this should only be of
> interest to Windows users in SDI, and only for the interactive default
> windows() device as far as I can tell.
>
> image.SpatialGridDataFrame now uses the base graphics function
> rasterImage() by default - this change was added for sp_0.9-64, and
> this allows for quite large (up to available memory capacity)
> SpatialGrids to be plotted efficiently with image(x).
>
> However, in SDI mode a fresh R session seems only to support five uses
> of rasterImage() that are drawn to a new device - the sixth and
> subsequent draws make no visible difference - until the device is
> manually resized. The problem cannot be reproduced in a single
> windows() session.
>
> To reproduce, in a fresh R session (Windows > 2.11.0 in SDI mode):
>
> ## create a dummy dataset
> m<- matrix(c(0.2, 0.4, 0.6, 0.8), 2, 2)
>
> ## simple helper function to open the windows() device and plot the matrix
> draw.f<- function(x) {
>   plot(0, xlim = c(0, 1), ylim = c(0, 1))
>   rasterImage(x, 0, 0, 1, 1, interpolate = FALSE)
> }
>
> draw.f(m)
>
> ## repeat the following 2 lines five times:
>
> dev.off()
> draw.f(m)
>
> On the fifth attempt, only the background plot appears - but the
> raster is visible on resize of the windows() device.
>
> I sent this to Paul Murrell, and with Duncan Murdoch he isolated it to
> the SDI mode of Windows.
>
> I don't know that there is any prospect of a fix - presumably it is
> rather deep down in the graphics code for Windows, but this note might
> save some frustation. If anyone can offer more information to track
> down where the problem is coming from that would be good.
>
>
> Cheers, Mike.
>
> R version 2.11.1 (2010-05-31)
> x86_64-pc-mingw32
>
> locale:
> [1] LC_COLLATE=English_Australia.1252  LC_CTYPE=English_Australia.1252
> [3] LC_MONETARY=English_Australia.1252 LC_NUMERIC=C
> [5] LC_TIME=English_Australia.1252
>
> attached base packages:
> [1] tools     stats     graphics  grDevices utils     datasets  methods
> [8] base
>
>
>
> --
> Michael Sumner
> Institute for Marine and Antarctic Studies, University of Tasmania
> Hobart, Australia
> e-mail: mdsumner at gmail.com
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>



-- 
Renaud Lancelot
EDEN Project, coordinator
http://www.eden-fp6project.net/
<< EDEN International Conference, Montpellier,  10-12 May 2010 >>
<<   http://international-conference2010.eden-fp6project.net/  >>

UMR CIRAD-INRA "Contrôle des maladies animales exotiques et émergentes"
Joint research unit "Control of emerging and exotic animal diseases"

CIRAD, Campus International de Baillarguet TA A-DIR / B
F34398 Montpellier
http://umr-cmaee.cirad.fr/

Tel.  +33 4 67 59 37 17  -  Fax  +33 4 67 59 37 95
Secr. +33 4 67 59 37 37  - Cell. +33 6 77 52 08 69



More information about the R-sig-Geo mailing list