Qu

bubble

Builtin index · Plotting

bubble(x, y, sizes)

Input: x, y, sizes · Output: no output

What it is

Scatter where marker radius encodes a third variable: x, y, sizes are equal-length numeric Vecs; the drawn radius is scaled from sizes's own min/max.

Overloads

One call shape — this function is not overloaded.

CodeInputOutputDescription
bubble(x, y, sizes)
x VecScatter where marker radius encodes a third variable: x, y, sizes are equal-length numeric Vecs.
y VecScatter where marker radius encodes a third variable: x, y, sizes are equal-length numeric Vecs.
sizes —the drawn radius is scaled from sizes's own min/max.
no output—

Examples

From the documentation, and run by the build -- the output and the figure below are what the engine actually produced. Simplest first.

x = 0 to 9
y = sin(x / 2)
figure()
errorbar(x, y, 0.1 * ones(10))
figure()
fill_between(x, y - 0.2, y + 0.2)
figure()
bubble(x, y, abs(y) * 20 + 5)
figure()
donut([30, 20, 50], "a", "b", "c")
figure()
pie([30, 20, 50], "a", "b", "c")
a (30%) b (20%) c (50%)

from plotting

How it works

bubble(x, y, sizes) — a scatter where marker radius encodes a third variable, scaled from sizes' own min/max (see Shape::Bubble's doc comment for the exact pixel range).

From the note above this builtin in the interpreter, where the reasoning was written down as it was built.