MATLAB Functions Help Desk

pie

Purpose

Pie chart

Syntax

Description

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

pie(X,Explode) offsets a slice from the pie. Explode is a vector or matrix of 0's and nonzeros that correspond to X. A non-zero value offsets the corresponding slice from the center of the pie chart, so that X(i,j) is offset from the center if Explode(i,j) is nonzero. Explode must be the same size as X.

h = pie(...) returns a vector of handles to Patch and Text graphics objects.

Remarks

If sum(X) 1, pie normalizes the X values so that each slice has an area of Xi/sum(Xi), where Xi is an element of X. The normalized value specifies the fractional part of each pie slice. If sum(X) < 1, pie does not normalize the elements of X. pie draws a partial pie when sum(X) < 1.

Examples

Emphasize the second slice in the chart by exploding it:

See Also

pie3



[ Previous | Help Desk | Next ]