[R] hdiffplot

emorway emorway at engr.colostate.edu
Mon Oct 18 19:01:14 CEST 2010


Hello, 

I'm trying to track down more information on hdiffplot than what is supplied
in ?hdiffplot.  More specifically, the example code found at the bottom
?hdiffplot ("##Compare *three* of them:") is something I'm very interested
in using for my own analysis.  However, I don't see how to add a legend or
even how to dig into the "bnlst" object that is created for determining what
the displayed colors mean.  The following example helps illustrate what I
mean:

library(hexbin)

x1 <- rnorm(10000)
y1 <- rnorm(10000)
x2 <- rnorm(10000,mean=1)
y2 <- rnorm(10000,mean=1)
x3 <- rnorm(10000,mean=1)
y3 <- rnorm(10000,mean=0)

xbnds <- range(x1,x2,x3)
ybnds <- range(y1,y2,y3)

bin1 <- hexbin(x1,y1,xbnds=xbnds,ybnds=ybnds)     
bin2 <- hexbin(x2,y2,xbnds=xbnds,ybnds=ybnds) 
bin3 <- hexbin(x3,y3,xbnds=xbnds,ybnds=ybnds) 

erodebin1 <- erode.hexbin(smooth.hexbin(bin1))
erodebin2 <- erode.hexbin(smooth.hexbin(bin2))
erodebin3 <- erode.hexbin(smooth.hexbin(bin3))

bnlst <- list(b1=erodebin1, b2=erodebin2, b3=erodebin3)
hdiffplot(bnlst)

Can 'grid.hexlegend' be used to add a legend somehow?

-Eric
-- 
View this message in context: http://r.789695.n4.nabble.com/hdiffplot-tp3000644p3000644.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list