Qu

pie

Builtin index · Plotting

pie(values, [label1, label2, ...])

Input: values, label1, label2, ... · Output: no output

What it is

Ordinary pie chart — same call shape as donut (values a Vec of numbers, trailing strings optional slice labels) with donut=false.

Overloads

One call shape — this function is not overloaded.

CodeInputOutputDescription
pie(values, [label1, label2, ...])
values Vec, number, or stringOrdinary pie chart — same call shape as donut (values a Vec of numbers, trailing strings optional slice labels) with donut=false.
label1, label2, ... optional, repeatablenot documented yet
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

pie(values, [labels...]) / donut(values, [labels...]) — labels are optional trailing string arguments, one per value.

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