pie
Legacy pie chart.
Syntax
pie(X)
pie(X, explode)
pie(X, labels)
pie(X, explode, labels)
pie(ax, ...)
p = pie(...)
Input argument
X - vector or matrix.
explode - Offset slices: numeric vector or matrix, logical vector and matrix, string array or cell array of character vectors.
labels - '%.0f%%' (default) or array of text labels
ax - Axes object.
Output argument
p - vector of patch and text objects.
Description
pie(X) generates a pie chart based on the data in the array variable X.
In cases where the sum of the elements in X is less than or equal to 1, the values in X directly represent the proportional areas of the pie slices.
If the sum of X is less than 1, the pie chart displays only a partial pie.
Alternatively, if the sum of X exceeds 1, the function normalizes the values by dividing each element by the sum of X.
This normalization ensures that the pie chart accurately reflects the relative proportions of the data.
In situations where X is a categorical variable, each slice of the pie corresponds to a category, and the area of each slice is determined by the ratio of the number of elements in the category to the total number of elements in X.
Examples
See also
History
1.0.0
initial version
Author
Allan CORNET
Last updated