[R] empty density plot for point pattern in spatstat

Christopher W Ryan cryan at binghamton.edu
Fri Jun 20 22:58:47 CEST 2014


I'm back in the office with the machine that was giving me trouble.

# fresh start-up of R 3.1.0, installed on the my machine's hard drive,
#under Windows XP Service Pack 3.
# spatstat version 1.37-0

library(spatstat)
data(redwood)
dens <- density(redwood)
str(dens) # everything looks to be in order
plot(dens)  # empty plot with empty ribbon on right side
dev.cur() # yields " null device
          #                    1"
		  # I think I closed the plot window
		  # before issuing this command
		
plot(dens, col=grey(seq(0,1,length=32)))		
# yields an empty density plot with empty ribbon
		
plot(dens, useRaster=FALSE)
# yields a proper density plot in blue/green/yellow,
# with an empty ribbon

plot(dens, useRaster=FALSE, ribargs=list(useRaster=TRUE))
# yields a proper density plot in blue/green/yellow,
# with an empty ribbon

dev.cur()
# yields "windows
#               2 "

example(plot.im)
# yields a series of 8 plot.
#All but one of them is empty--both plot area and ribbon
# the second one has a color ramp in the ribbon
# along the bottom, but again no plot

with(bei.extra,plot(elev))
# yields an empty plot with empty ribbon

with(bei.extra,plot(elev, useRaster=FALSE))
with(bei.extra,plot(elev, useRaster=FALSE,  ribargs=list(useRaster=TRUE)))
# these both yield the same result:
# a colored density plot with an empty ribbon

Thanks

--Chris Ryan

On Thu, Jun 19, 2014 at 8:31 PM, Adrian Baddeley
<adrian.baddeley at uwa.edu.au> wrote:
> Dear Pablo,
>
>> Yes, effectively utilizando useRaster = FALSE, the plot is printed.
>
> Muy bien!
>
>> Only the ribbon appears without color.
>
> Try setting ribargs=list(useRaster=TRUE).
>
>> I'm using R version 3.0.2, Windows 7 system, and spatstat 1.33-0 package version.
>
> Things may improve if you upgrade to the current versions, R 3.1.0 and spatstat 1.37-0.
>
> A
>
> Prof Adrian Baddeley FAA
> University of Western Australia



More information about the R-help mailing list