Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

pie3

Syntax

pie3(X)
pie3(X,explode)
pie3(...,labels)
pie3(axes_handle,...)
h = pie3(...)

Description

pie3(X) draws a three-dimensional pie chart using the data in X. Each element in X is represented as a slice in the pie chart.

  • If sum(X) ≤ 1, then the values in X directly specify the area of the pie slices. pie3 draws only a partial pie if sum(X) < 1.

  • If the sum of the elements in X is greater than one, then pie3 normalizes the values by X/sum(X) to determine the area of each slice of the pie.

pie3(X,explode) specifies whether to offset a slice from the center of the pie chart. X(i,j) is offset from the center of the pie chart if explode(i,j) is nonzero. explode must be the same size as X.

pie3(...,labels) specifies text labels for the slices. The number of labels must equal the number of elements in X.

pie3(axes_handle,...) plots into the axes with the handle axes_handle instead of into the current axes (gca).

h = pie3(...) returns a vector of handles to patch, surface, and text graphics objects.

Examples

collapse all

Create a 3-D pie chart of vector x.

x = [1,3,0.5,2.5,2];
figure
pie3(x)

To offset the second pie slice, set the corresponding explode element to 1.

explode = [0,1,0,0,0];
figure
pie3(x,explode)

Create a 3-D pie chart and specify the text labels.

x = 1:3;
labels = {'Taxes','Expenses','Profit'};
    
figure
pie3(x,labels)

See Also

Introduced before R2006a

Was this topic helpful?