Scilab Website | Contribute with GitLab | Mailing list archives | ATOMS toolboxes
Scilab Online Help
6.0.0 - English

Change language to:
Français - 日本語 - Português - Русский

Please note that the recommended version of Scilab is 2024.1.0. This page might be outdated.
See the recommended documentation of this function

Scilab Help >> Graphics > pie


draw a pie





a scalar or a vector of positive reals.


a real scalar or a vector of reals.


a cell or a vector of strings.


pie(x): if size of x is N then pie function draws a pie with N parts, the area of the ith part is equal to (x(i)/sum(x))*( surface of the unit circle).

pie(x,sp):the sp vector allows to cut one or several parts of the pie, (the size of sp must be equal to N). if the value of the ith index of sp is different of zero then the ith part is separated from the others by a space, else if it' s equal to zero then it is attached to the others.

pie(x,txt): the txt vector allows to write a text for each part of the pie, the ith component of txt corresponds to the ith part (default : it's written the percentages which corresponds to the parts surface). The size of txt must be equal to N.


// First example : one input argument  x=[1 2 5]
pie([1 2 5]);
// Second example : two input arguments x=[5 9  4 6 3], sp=[0 1 0 1 0], the second and the fourth are separated of the others
pie([5 9 4 6 3],[0 1 0 1 0]);
// Third example : three input arguments, x=[3 4 6 2], sp=[0 1 0 0], txt=["part1","part2","part3","part4"]
pie([3 4 6 2],[0 1 0 0],["part1","part2","part3","part4"]);

See also

Report an issue
<< object editor Graphics Segments properties >>

Copyright (c) 2022-2024 (Dassault Systèmes)
Copyright (c) 2017-2022 (ESI Group)
Copyright (c) 2011-2017 (Scilab Enterprises)
Copyright (c) 1989-2012 (INRIA)
Copyright (c) 1989-2007 (ENPC)
with contributors
Last updated:
Tue Feb 14 15:02:52 CET 2017