
Last chance! 50% off unlimited learning
Sale ends in
gplot.hexbin(x, style = "colorscale", legend = 1.2, lcex = 1,
minarea = 0.04, maxarea = 0.8, mincnt = 1, maxcnt = max(x@count),
trans = NULL, inv = NULL, colorcut = seq(0, 1, length = min(17, maxcnt)),
border = NULL, density = NULL, pen = NULL,
colramp = function(n) LinGray(n,beg = 90,end = 15),
xlab = "", ylab = "", main = "", newpage = TRUE,
type = c("p", "l", "n"), xaxt = c("s", "n"), yaxt = c("s", "n"),
clip = "on", verbose = getOption("verbose"))## S3 method for class 'hexbin,missing':
plot(x, style = "colorscale", legend = 1.2, lcex = 1,
minarea = 0.04, maxarea = 0.8, mincnt = 1, maxcnt = max(x@count),
trans = NULL, inv = NULL, colorcut = seq(0, 1, length = min(17, maxcnt)),
border = NULL, density = NULL, pen = NULL,
colramp = function(n) LinGray(n,beg = 90,end = 15),
xlab = "", ylab = "", main = "", newpage = TRUE,
type = c("p", "l", "n"), xaxt = c("s", "n"), yaxt = c("s", "n"),
clip = "on", verbose = getOption("verbose"))
hexbin
.grid.hexagons
for the possibilities.FALSE
.
In the latter case, or when 0
, no legend is not produced.function
specifying a transformation for
the counts such as sqrt
.trans
.<= maxcnt<="" code="">) specifying the
number of equispaced colorcut values in [0,1].
grid.hexagons
.n
as an argument and
returning n colors."n"
) for
suppressing the plotting of hexagon symbols, or the x- or y-axis,
respectively.gplot.hexbin
can also be used for
the S4 plot
method.hexViewport
constructed and used.viewport
.plot
method for hexbin
(and
erodebin
) objects (erodebin-class). To use the standalone function
gplot.hexbin()
is deprecated.
For style
, minarea
etc, see the Details section of
grid.hexagons
's help page.
The legend functionality is somewhat preliminary. Later versions may include refinements and handle extreme cases (small and large) for cell size and counts.
grid.hexagons
.hexbin
, hexViewport
,
smooth.hexbin
,
erode.hexbin
,
hcell2xy
, hboxplot
,
hdiffplot
.## 1) simple binning of spherical normal:
x <- rnorm(10000)
y <- rnorm(10000)
bin <- hexbin(x,y)
## Plot method for hexbin !
## ---- ------ --------
plot(bin)
# nested lattice
plot(bin, style= "nested.lattice")
# controlling the colorscheme
plot(bin, colramp=BTY, colorcut=c(0,.1,.2,.3,.4,.6,1))
## 2) A mixture distribution
x <- c(rnorm(5000),rnorm(5000,4,1.5))
y <- c(rnorm(5000),rnorm(5000,2,3))
bin <- hexbin(x,y)
pens <- cbind(c("#ECE2F0","#A6BDDB","#1C9099"),
c("#FFF7BC","#FEC44F","#D95F0E"))
plot(bin, style = "nested.lattice", pen=pens)
# now really crazy
plot(bin, style = "nested.lattice", pen=pens,border=2,density=35)
# lower resolution binning and overplotting with counts
bin <- hexbin(x,y,xbins=25)
P <- plot(bin, style="lattice", legend=FALSE,
minarea=1, maxarea=1, border="white")
##
pushHexport(P$plot.vp)
xy <- hcell2xy(bin)
# to show points rather than counts :
grid.points(x,y,pch=18,gp=gpar(cex=.3,col="green"))
grid.text(as.character(bin@count), xy$x,xy$y,
gp=gpar(cex=0.3, col="red"),default.units="native")
popViewport()
# Be creative, have fun!
Run the code above in your browser using DataLab