pie3

Three-dimensional pie chart of the values in a vector.

Category: Graphics > 2-D and 3-D Plots

Syntax

pie3(X)

Draws one slice per element, with a thickness, and percentage labels.

pie3(X, explode)

Pulls out the slices where explode is nonzero.

pie3(X, labels)

Uses the cell array labels as slice labels.

h = pie3(___)

Also returns the handles of the graphics objects.

Description

It is the 3-D variant of pie: the same proportions, drawn as a disk with thickness that you can rotate with view. The extra dimension adds no information and can distort how large the slices look, so use it sparingly.

Input arguments

X
Vector of non-negative values.
explode
Logical or numeric vector of the same length as X.
labels
Cell array of text, one per slice.

Output arguments

h
Array of handles: for each slice a top, a side surface and a text label.

Example

Three slices

h = pie3([2 3 5]);
numel(h)
Output
ans = 12

See also

pie piechart bar3 view