Docs / Shapes / Frequencies

Frequencies Shape

The Frequencies shape groups a run by the discrete values a term takes and shows, for each of them, what every series makes of the readings that fell there.

Screenshot: Frequencies chart counting the colours a term took, with the mean of a second term on the right axis

Overview

Some terms do not take a range of values but one of a set: a colour name, a fruit, a player number, the face a die landed on. There is no curve to plot for such a term — what there is to see is how often each of its values came up, and what the rest of the model was doing when it did.

A Frequencies shape answers both. One axis carries the values the category term can take. Every series answers for each of those values with a single number: how many readings there were, or what its own term summed, averaged, or spread to across them.

Where a Chart plots one term against another reading by reading, a Frequencies chart reads the whole run at once and reports it category by category.

The Category Axis

The category axis is built from the term named in Categories:

Functions

Each series names a function, chosen from the button at the end of its row. The function decides what the series makes of the readings that fell into a category.

FunctionAnswers with
CountHow many readings in the category held a value for the series term. With the category term itself as the series term, this is the frequency of each value.
ProbabilityThe share those readings are of every reading the series made, so the categories together come to 1. Over a long enough run it is what the model says the chance of that value is.
SumThe total of the series term over the category.
MeanThe average of the series term over the category.
MedianThe middle reading, or the average of the middle two.
Minimum / MaximumThe lowest and the highest reading in the category.
Standard deviationThe spread of the readings, as a sample.
Counting carries no unit. However the term is measured, how many times it was read — and what share of the whole that is — are bare numbers, so the axis such a series is read against says count(z) or P(z) and nothing more.

Two Value Axes

A count runs to a handful and an average may run to hundreds. Read against one scale, the smaller of the two flattens against the axis. So each series is assigned a value axis of its own choosing — named on its row by the edge that axis runs along, drawn rather than written — and the two carry separate scales:

AxisUpright chartChart on its side
PrimaryLeftBottom
SecondaryRightTop

Each axis is fitted to what its own series reached, and each is named along its edge by the series read against it, so a mark can be traced back to the scale it belongs to without a legend sitting apart from the chart. The grid is drawn for the primary axis alone: a second set of lines would cross it at values that mean nothing on it.

An axis that carries a bar always includes zero, because a bar is drawn from zero. An axis carrying only symbols is fitted tightly around its values.

Marks

Every series is drawn with a mark and a colour of its own, both chosen in its row. The mark is picked from a list that draws each one, and the row itself carries that mark beside the name of the function, so what a series is and what it will look like are read off the row without opening it.

MarkDrawn as
BarA column from the axis zero. Bar series stand side by side inside the band of their category, one slot each, so no bar hides another.
Circle, Square, Triangle, DiamondA symbol on the middle of the band, which reads as a value taken over the whole category rather than as one column among several.

Turning on the eye beside a series writes the number it answered with beside each of its marks.

Orientation

The chart is drawn upright or on its side, from the Orientation row of the settings menu.

Category labels that are too wide for their band are turned on an upright chart. Long labels — fruit and colour names — read better with the chart on its side.

Scale

While Auto Scale is on, both value axes are fitted to what their own series reached. Turning it off hands the four ends to the two rows below it; an end left empty is still the chart's own to find.

Properties

PropertyDescription
categoryTermTerm whose discrete values make the category axis.
categoryTermCaseCase the category term is read in.
orientationvertical or horizontal.
seriesOne entry per series: term, case, aggregate (count, probability, sum, mean, median, min, max, sd), axis, mark, color, showLabel.
autoScaleWhen true, both value axes fit themselves to their series.
valueRangeThe four ends — primaryMin, primaryMax, secondaryMin, secondaryMax — used while auto scale is off.
See Model Schema for the full shape definition, and Expression for how a term is held to a set of labels.