bin.hex Function (GPL)

Syntax

bin.hex.<position>(<algebra>, dim(<numeric>), <function>)

or

bin.hex.<position>(<binning function>, dim(<numeric>), <function>)

or

bin.hex.<position>(<statistic function>, dim(<numeric>), <function>)

<position>. The position at which a graphic element representing the bins is drawn. center is the graphical middle of the bin and makes it less likely that the graphic elements will overlap. centroid positions the graphic element at the centroid location of the values it represents. The coordinates of the centroid are the weighted means for each dimension. Specifying the position is optional. If none is specified, center is used.

<algebra>. Graph algebra, such as x*y. Refer to Brief Overview of GPL Algebra for an introduction to graph algebra.

<numeric>. One or more numeric values (separated by commas) indicating the graph dimension or dimensions in which to bin the data. Using dim() is optional.Specifying the dimensions is necessary only when you want to bin a specific non-default dimension or multiple dimensions, for example when binning a 2-D scatterplot. See the topic dim Function (GPL) for more information.

<function>. One or more valid functions. These are optional.

<binning function>. A binning function.

<statistic function>. A statistic function.

Description

Creates hexagonal bins for grouping similar cases. bin.hex is most often used when creating binned scatterplots or other binned multivariate graphs.

Examples

Figure 1. Example: Binned scatterplot
ELEMENT: point(position(bin.hex(salbegin*salary, dim(1,2))), size(summary.count()))
Figure 2. Example: Binned polygon
ELEMENT: polygon(position(bin.hex(salbegin*salary, dim(1,2))), color(summary.count()))

Statistic Functions

See GPL Functions .