lollipop
A value drawn as a stem from the baseline with a dot at its end.


#Values at positions
lollipop(x: 0, 1, 2, 3; y: 0.125, 0.375, 0.375, 0.125) draws a stem from the baseline to each value, with a dot at its end, the two series paired by position as a scatter's are. A stem occupies only the value it stands at, which is the shape of a quantity that belongs to a single value — a probability mass P(X = k) — where a bar would draw an interval around k.
The stems stand on an axis ruled in names, and run along the other: lollipop(x: 0.42, 0.31, 0.19; y: North, South, East) runs them out along x. With both axes numeric, orientation decides: vertical (the default) or horizontal. Both axes in names are refused (canvas/lollipop-axes). In space a stem stands on the floor at each (x, y) and rises to its z; all three are required there.
#Tallying readings
One coordinate alone is the readings, and the mark counts them: lollipop(x: #rolls.face) stands a stem at every distinct value, as tall as the number of times it occurs. Nothing is binned. The counts run along the other axis, which must be numeric:
graph{
lollipop(x: #rolls.face)
}(
y format: few, many
)[canvas/lollipop-axes]'lollipop(x: …)' counts its readings and stands the counts up the y axis, which is ruled in names — a count is a number
#Lollipops side by side
Where two or more lollipop marks have a stem at the same position, the stems stand side by side there in source order, so two distributions are read stem against stem. A position only one of them has keeps its stem where it is.
graph{
lollipop(x: 0, 1, 2, 3, 4; y: 0.240, 0.412, 0.265, 0.076, 0.008; colour: blue; label: $\mathrm{Bin}(4, 0.3)$)
lollipop(x: 0, 1, 2, 3, 4; y: 0.301, 0.361, 0.217, 0.087, 0.026; colour: orange; label: $\mathrm{Poisson}(1.2)$)
}#Error bars
error draws a capped bar through each dot along its stem, written as a scatter's is: a half-width per stem, or the interval's two ends. It needs both x and y — a tallied stem is a count of readings, with no row of its own to carry one.
graph{
lollipop(x: #rates.month; y: #rates.rate; error: #rates.lo .. #rates.hi)
}#Attributes
x#rolls.face). Paired with y by position; a pair either axis cannot read is dropped whole. Written alone it is the readings instead, and the mark counts them.lollipop:valueyx by position — or, written alone, the readings to be counted, with the counts running out along x.orientationverticalhorizontalverticalcolourbar's, from a column or #self.value — colour: #self.value -> (..<0: red; 0..: blue).colour-stylecolorbluesizescatter's markers take: one size, a list stem by stem, or an expression giving one per stem, size: #self.value -> 0..100 -> 4 + 8_.size-style6widthline's: one width, a list stem by stem, or an expression giving one per stem — width: #self.value -> 0..100 -> 1 + 5_.width-style2opacityopacity-style1stylesolid, dashed or dotted. One style, a list stem by stem, or an expression giving one per stem, as colour: takes.stroke-style-stylesolidshow-labelslabelsfalselabel$maths$ and inline formatting render. Fades and draws with the element.hiddenhidden: true !cue.to{false}(at: 2) reveals it — and unlike a cue, a hidden element still frames the plot, so the axes do not jump when it appears.falselockeditable: graph. Nothing at all on a graph that is not editable.lockedfalsetext-size20layerz: before the argand plane took that letter for its coordinate.groupgroup: Treated, Projected. It is drawn in the colour of the first group that has one, over its own colour:, and the footer's key names every group. A stroke the graph's key: gives a group does not change it.xyplaneerrorerror: #trials.lo .. #trials.hi — as a scatter's error: takes. Only where both x: and y: are written; a tallied stem is a count, with no row to carry one.xyzplanezx and y.#Derived attributes
Computed while the element renders — read one with #id.name in attribute position or {{#id.name}} in prose, never set.
value#self.value: size: #self.value -> 0..1 -> 4 + 8_.totalmaxmincount#Allowed in
#Examples


graph{
lollipop(x: #rolls.face)
}

graph{
lollipop(
x: 0.42, 0.31, 0.19
y: North, South, East
show-labels
)
}

graph{
lollipop(
x: 0, 1, 2, 3, 4, 5, 6, 7, 8
y: 0.028, 0.121, 0.233, 0.267, 0.200, 0.103, 0.037, 0.009, 0.001
colour: blue
label: $\mathrm{Bin}(10, 0.3)$
)
lollipop(
x: 0, 1, 2, 3, 4, 5, 6, 7, 8
y: 0.050, 0.149, 0.224, 0.224, 0.168, 0.101, 0.050, 0.022, 0.008
colour: orange
label: $\mathrm{Poisson}(3)$
)
}(
x domain: [-1, 9]
y domain: [0, 0.3]
)

graph:xyz{
lollipop(x: 1, 1, 1, 2, 2, 2, 3, 3, 3; y: 1, 2, 3, 1, 2, 3, 1, 2, 3; z: 0.05, 0.10, 0.05, 0.10, 0.30, 0.10, 0.05, 0.10, 0.15)
}(
z axis label: probability
)