hboxplot {hexbin}R Documentation

2-D Generalization of Boxplot


If bin1 is a hexbin object with an erode component. Then, hboxplot() plots the high counts cells selected by the erode function. By default, the high counts cells contain 50 percent of the counts so analagous to the interquartile range. The function distinguishes the last cells eroded using color. These cells correspond to one definition of the bivariate median.


hboxplot(bin1, xbnds = bin1$xbnds, ybnds = bin1$ybnds,
         density = c(-1,-1), border = c(FALSE, FALSE), pen = c(2, 3),
         unzoom = 1.04, reshape = FALSE,
         xlab = "", ylab = "", ...)


bin1 an object of class hexbin.
xbnds global x-axis plotting limits for multiple plots.
ybnds global y-axis plotting limits for multiple plots.
density, border arguments for polygon() each of length two, the first for the median, the second for the other cells.
pen colors (“pen numbers”) for polygon().
unzoom plot limit expansion factor when xbnds is missing.
reshape logical value to reshape the plot although xbnds and ybnds are present.
xlab, ylab x- and y- axis labels passed to plot().
... additional arguments passed to plot().


The density, border, and pen arguments correspond to the polygon function calls for plotting two types of cells. The cell types, pen numbers and suggested colors are
cells of bin1 2 light gray
last eroded cells of bin1 (median cells) 1 black

The erode components of the hexbin objects must be present for the medians cells to plot.

When xbnds is missing or reshape is true, the plot changes graphics parameters and resets them. When xbnds is missing the function also zooms in based on the available data to provide increased resolution.

The zoom used the hexagon cell centers. The unzoom argument backs off a bit so the whole hexagon will fit in the plot.

Hboxplot() is used as a stand alone function, for producing separate legends for hmatplot() and for panels in hmatplot().


If (missing(xbnds) $|$ reshape)screen.par else 'done'


see in hexagons.

See Also

hexbin, smooth.hexbin, erode.hexbin, hcell2xy, hcell plot.hexbin, hmatplot, hexagons, hex.legend


##  boxplot of smoothed counts
x <- rnorm(10000)
y <- rnorm(10000)

bin <- hexbin(x,y)
erodebin <- erode.hexbin(smooth.hexbin(bin))

hboxplot(erodebin, density = c(32,7), border = c(2,4))
hboxplot(erodebin, density = c(-1,17),
         main = "hboxplot(erode*(smooth*(.)))")

[Package hexbin version 1.0.10 Index]