Statistics
PieChart
generate pie charts
Calling Sequence
Parameters
Description
Options
Examples
Compatibility
PieChart(X, options, plotoptions)
PieChart['interactive'](X)
X
-
data
options
(optional) equation(s) of the form option=value where option is one of datasetlabels, color, explode, sector, annular, or render3d; specify options for generating the pie chart
plotoptions
options to be passed to the plots[display] command
The PieChart command generates a pie chart for the specified data.
The first parameter X is a list of equations of the form value=frequency. A list or Vector of values can also be given, in which case all frequencies are set equal.
If the ['interactive'] option is used, then a dialog box appears that allows for customized creation of the plot.
The options argument can contain one or more of the options shown below. All unrecognized options will be passed to the plots[display] command. See plot/options for details.
datasetlabels=default, none, relative, absolute, or list
This option controls data set labels on the pie slices. By default, PieChart uses data values as labels. The relative option displays, for each pie slice, the percentage value that pie slice occupies in the pie. The absolute option displays, for each pie slice, the absolute frequency of the corresponding value. Finally, you can specify data set labels as a list of strings.
sector=range
This option specifies (in degrees) which part of the pie will be used by the chart. The default value is 0..360.
color=name, list, or range
This option specifies colors for the individual data sets. When a list of colors is given, each of the pie slices is colored with the corresponding color in the list.
If a range of colors is given, the colors are generated by selecting an appropriate number of points using the command ColorTools[Gradient] with the best option. In this case:
If the sector option is used to select less than the full pie, the colors of the slices will be assigned so that one end of the sector has the first color, and the other end has the other color.
If the full pie is selected (by omitting the sector option, or by explicitly selecting sector = 0 .. 360), then the colors of the slices will be assigned so that they are continuous along the full pie: one slice will have the first specified color, then subsequent colors in the range are assigned alternatingly to the next uncolored slice counterclockwise and the next uncolored slice clockwise, continuing until the last slice gets the second specified color.
explode=list
If X is a Vector or a list, specify the list of indices in X which corresponds to the pie slice to be exploded. They need not be in order. If X is a list of equations, specify the left-hand side values in the list which corresponds to the pie slice to be exploded.
annular=true, false, nonnegative, or range
This option specifies that the PieChart should be drawn on an annulus instead of a disk. If the option is given alone or as annular=true then an annulus of inside radius 1 and outside radius 2 is used. If a number is specified, that number is used for the inside radius and the outside radius is one greater. This is useful for nesting charts. If a range is specified, the left- and right-hand sides of the range are used for the inside and outside radii (respectively).
render3d=true, false, or nonnegative
This option specifies that the PieChart should be drawn as a 3-D plot. If the option is given alone or as render3d=true then the a circular chart is drawn with thickness 0.5, and an annular chart is drawn with a thickness corresponding to 1/2 of its outer radius plus one. If an integer is given then the chart will be as thick as an annular chart with that inside radius. If a non-integer number is specified, it is used as the exact thickness of the chart.
with⁡Statistics:
PieChart⁡1,1,2,3
A≔seq⁡i=sqrt⁡i,i=1..15:
PieChart⁡A,sector=0..180
B≔seq⁡i=sqrt⁡abs⁡7−i+1,i=1..16,2
B≔1=6+1,3=3,5=1+2,7=1,9=1+2,11=3,13=6+1,15=2⁢2+1
PieChart⁡B,sector=0..270,annular
plotsdisplay⁡PieChart⁡A,annular=1,PieChart⁡B,sector=90..270,annular=2
plotsdisplay⁡PieChart⁡A,annular=1,render3d,PieChart⁡B,sector=90..270,annular=2,render3d=1
The commands to create the plot from the Plotting Guide are
T≔StringTools:-CharacterFrequencies⁡honorificabilitudinitatibus
T≔a=2,b=2,c=1,d=1,f=1,h=1,i=7,l=1,n=2,o=2,r=1,s=1,t=3,u=2
PieChart⁡T,color=Crimson..Gold,explode=seq⁡i,i=a..i
plotsdisplay⁡PieChart⁡A,sector=45..225,annular=2.25..4,color=MediumTurquoise..MediumVioletRed,PieChart⁡B,sector=30..270,annular=1,color=MediumTurquoise..Navy,PieChart⁡A5..10,annular=false,color=Navy..MediumTurquoise,PieChart⁡T,color=Crimson..Gold,explode=seq⁡i,i=j..u,annular=4.25..6
The annular and render3d options were introduced in Maple 16.
For more information on Maple 16 changes, see Updates in Maple 16.
See Also
Statistics/Visualization
Statistics[AreaChart]
Statistics[PointPlot]
Download Help Document