Skip to content

Histogram ​

Given data alone, held inert and drawn as a histogram picture; given a bin spec too, computed as compute-engine's own Histogram\mathrm{Histogram} does.

Histogram(data, bins)with one argument held inert and drawn as a picture; with a bin spec, computed as compute-engine's own Histogram\mathrm{Histogram} does
Typed signatures
TypePackageApplies
(collection<nothing | number>, list<number> | number) -> list<tuple<number, integer>>compute-enginealways
(collection<any>, (list<number> | number)?) -> anyformatsreplaces compute-enginealways

Domain: Graphics·Drawn as Graphics

Examples

Basic #

Given data alone it is held inert, to be drawn as a histogram

live ↗
InHistogram([1,2,2,3,3,3])\mathrm{Histogram}(\bigl\lbrack1, 2, 2, 3, 3, 3\bigr\rbrack)OutHistogram([1,2,2,3,3,3])\mathrm{Histogram}(\bigl\lbrack1, 2, 2, 3, 3, 3\bigr\rbrack)

Given a bin spec it computes the counts, as compute-engine does

live ↗
InHistogram([1,2,2,3,3,3],[1,2,3,4])\mathrm{Histogram}(\bigl\lbrack1, 2, 2, 3, 3, 3\bigr\rbrack, \bigl\lbrack1, 2, 3, 4\bigr\rbrack)Out[(1,1),(2,2),(3,3)]\bigl\lbrack(1,1), (2,2), (3,3)\bigr\rbrack

Data alone is held, then drawn with the bin count Sturges' rule picks

live ↗
InHistogram([1,2,2,3,3,3,4,4,4,4,5,5,5,6,6,7])\mathrm{Histogram}(\bigl\lbrack1, 2, 2, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 6, 6, 7\bigr\rbrack)OutHistogram([1,2,2,3,3,3,4,4,4,4,5,5,5,6,6,7])\mathrm{Histogram}(\bigl\lbrack1, 2, 2, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 6, 6, 7\bigr\rbrack)
About
Examples3