Skip to content

pie

plot · scripts/plot/draw/pie.m

: pie (x)
: pie (x, explode)
: pie (x, labels)
: pie (x, explode, labels)
: pie (ax, …)
: h = pie (…)

Draw a pie chart of the non-negative vector x.

Each element becomes a slice whose size is its share of the total; when the total is less than 1 the values themselves are taken as fractions and the pie is incomplete. Slices are numbered clockwise from the top. Non-zero entries of explode move the corresponding slices outward. labels is a cell array of strings; by default each slice is labelled with its percentage.

The return value is a column vector holding, for every slice, its patch followed by its text label.