plot::Piechart2d

2D pie charts

MuPAD® notebooks will be removed in a future release. Use MATLAB® live scripts instead.

MATLAB live scripts support most MuPAD functionality, though there are some differences. For more information, see Convert MuPAD Notebooks to MATLAB Live Scripts.

Syntax

plot::Piechart2d([d1, d2,...], <a = amin .. amax>, options)
plot::Piechart2d(A, <a = amin .. amax>, options)

Description

plot::Piechart2d([d1, d2, d3,...]) creates a 2D pie chart with pieces of size ratios .

With the input data d1, d2 etc., the i-th piece of the pie has the opening angle 2πdid1d2.

The attribute Titles lets you attach titles to the pieces of the pie chart. In contrast to the overall title of the pie chart (Title, TitleFont), the titles of the pieces react to TextFont.

The attribute Moves lets you move the pieces away from the pie center for highlighting.

The attributes Center and Radius let you position and scale a pie chart relative to other graphical objects in the same scene.

Attributes

AttributePurposeDefault Value
AffectViewingBoxinfluence of objects on the ViewingBox of a sceneTRUE
AntiAliasedantialiased lines and points?TRUE
Centercenter of objects, rotation center[0, 0]
CenterXcenter of objects, rotation center, x-component0
CenterYcenter of objects, rotation center, y-component0
Colorthe main color 
Colorslist of colors to use[RGB::Blue, RGB::Red, RGB::Green, RGB::MuPADGold, RGB::Orange, RGB::Cyan, RGB::Magenta, RGB::LimeGreen, RGB::CadmiumYellowLight, RGB::AlizarinCrimson]
Datathe (statistical) data to plot[1]
Filledfilled or transparent areas and surfacesTRUE
FillPatterntype of area fillingSolid
Framesthe number of frames in an animation50
Legendmakes a legend entry 
LegendTextshort explanatory text for legend 
LegendEntryadd this object to the legend?FALSE
LineColorcolor of linesRGB::Black
LineWidthwidth of lines0.35
LineStylesolid, dashed or dotted lines?Solid
LinesVisiblevisibility of linesTRUE
Movesdisplacements of pieces in pie charts[0]
Namethe name of a plot object (for browser and legend) 
ParameterEndend value of the animation parameter 
ParameterNamename of the animation parameter 
ParameterBegininitial value of the animation parameter 
ParameterRangerange of the animation parameter 
Radiusradius of circles, spheres etc.1
TextFontfont of text objects[" sans-serif ", 11]
TimeEndend time of the animation10.0
TimeBeginstart time of the animation0.0
TimeRangethe real time span of an animation0.0 .. 10.0
Titleobject title 
Titleslist of titles for object parts[" "]
TitleFontfont of object titles[" sans-serif ", 11]
TitlePositionposition of object titles 
TitleAlignmenthorizontal alignment of titles w.r.t. their coordinatesCenter
TitlePositionXposition of object titles, x component 
TitlePositionYposition of object titles, y component 
VisiblevisibilityTRUE
VisibleAfterobject visible after this time value 
VisibleBeforeobject visible until this time value 
VisibleFromToobject visible during this time range 
VisibleAfterEndobject visible after its animation time ended?TRUE
VisibleBeforeBeginobject visible before its animation time starts?TRUE

Examples

Example 1

Create a 2D pie chart with pieces of the size ratios 1:2:1:3:2.5.

p := plot::Piechart2d([1, 2, 1, 3, 2.5]):
plot(p)

Set titles for the pieces:

p::Titles := ["10.5%", "21.1%", "10.5%", "31.6%", "26.3%"]:
plot(p)

Pieces can be moved away from the pie center with the attribute Moves. One or more moves can be given as a list of values [f1, f2,...]. The “move factors” f1, f2, and so on, are positive real values that represent fractions of the pie radius. The i-th piece is moved away from the center by fi. To move only some pieces, you can specify Moves = [n1 = f1, n2 = f2, …], such that only the pieces with indices n1, n2, and so on, are moved:

p::Moves := [1 = 0.3, 3 = 0.5]:
plot(p)

delete p:

Parameters

d1, d2, …

The sizes of the pieces: nonnegative real values or arithmetical expressions of the animation parameter a.

d1, d2,... is equivalent to the attribute Data.

A

A matrix or array containing the data d1, d2, and so on.

a

Animation parameter, specified as a = amin..amax, where amin is the initial parameter value, and amax is the final parameter value.