"hexbin"
Object
hexbin
.
This function is primarily support for the function
plot.hexbin
.
hexagons(bin, style="grayscale", cuts=16, col.regions= trellis.par.get("regions")$col, at, mincount=1, rmaxcount=max(bin$count), minarea=0.04, maxarea=0.8, density=-1, border=F)
"hexbin"
.
"grayscale","lattice","centroids","nested.lattice",
or
"nested.centroids"
representing the style of plot desired.
See the DETAILS section for the description of each option.
Partial string matching is allowed.
at
vector. How many different
colors are used will depend, to an extent, on this parameter. Default is
16
.
trellis.device
will ensure that a colormap close to adequate is used.
See the DETAILS section for ways to select other colormaps.
at
is omitted, it is computed
as
seq(min(bin$count),max(bin$count),length=cuts).
mincount
are not shown.
maxcount
are not shown.
minarea
.
density
argument to the S-PLUS function
polygon
.
The five plotting styles are:
style="grayscale"
A smoothly varying color mapping of the counts is determined from the
values in
cuts
,
at
, and
col.regions
.
The best use of this option requires that the plotting device is activated
through a call to the S-PLUS function
trellis.device
. This ensures that
an adequate color map is the default although other devices as well as
customized colormaps can be provided by the user.
style="lattice"
or
"centroids"
Plots the hexagons in sizes proportional to cell counts. The
"lattice"
option places the hexagons at the lattice centers. In some cases,
the regularity of this structure may be visually overwhelming.
In those cases, the user should use the
"centroids"
option which places the hexagons at their centers of mass. This results in the
breaking of the regularity of the lattice structure thereby placing the
focus on other properties of the data.
In all cases the hexagons will not plot outside
the cell unless
maxarea > 1
.
style="nested.lattice"
and
"nested.centroids"
Two overlaying hexagons are plotted: a background hexagon with area
covering the full hexagon's and color proportional to the cell count in
powers of 10 and a
foreground hexagon with area proportional to
log10(count)-floor(log10(count)).
When
style="nested.centroids"
counts <10 are plotted and the centers of
the plotted hexagons are placed at their centers of mass.
The outside color encodes hexagon size within color contours representing
powers of
10
.
Different color schemes give different effects including 3-D illusions
The hexagon sizes are scaled proportionally to cell counts by
scaling the counts between
mincount
and
maxcount
and then
mapping to areas between
minarea
and
maxarea
.
Plotting the symbols near the center of mass is not only more accurate,
it helps reduce the visual dominance of the lattice structure. Of
course higher resolution binning reduces the possible distance between
the center of mass for a bin and the bin center. When symbols
nearly fill their bin, the plot appears to vibrate. This can be
partially controlled by reducing
maxarea
or by reducing
contrast.
The local background influences color interpretation.
Having defined color breaks to focus attention on
specific contours can help. See
nested
options.
Carr, D. B. (1991). Looking at large data sets using binned data plots. In Computing and Graphics in Statistics. A. Buja and P. Tukey, eds. Springer-Verlag, New York. pp. 7-39.
x <- quakes.bay[,"longitude"]; y <- quakes.bay[,"latitude"] bin <- hexbin(x, y) plot(range(bin$x), range(bin$y), type='n') hexagons(bin)