Heights, Moves

Heights of pieces in 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.

Value Summary

Heights, MovesOptionalList of arithmetical expressions

Graphics Primitives

ObjectsDefault Values
plot::Piechart3d

Heights: [0.3]

Moves: [0]

plot::Piechart2d

Moves: [0]

Description

Heights, Moves determine the heights and displacements of the single pieces in a pie chart.

Heights determines the heights of the pieces in a plot::Piechart3d. If no height value is given for a piece, 0.3 is used. The given values have to be real numbers or expressions of the animation parameter.

Moves determines the movements of pieces away from the pie chart center. If no move value is given for a piece, 0 is used. The given values have to be non-negative real numbers or expressions of the animation parameter. The values are fractions of the Radius of the pie chart. A value of 1 means a full pie chart radius, 0.5 half the radius of the pie chart etc.

Heights, Moves accept its input in two formats:

  • The values can be given as a flat list of values with entries of the type specified above. The first list entry will be used for the first piece etc. If the list contains less values than the data set of the pie chart, the last value is repeated. Superfluous entries are ignored.

  • The values can be given as a list of equations with positive integers on the left hand side and values – as specified above – on the right hand side. The integers are interpreted as indices of the pieces.

Examples

Example 1

We move the third piece of the following pie chart away from the center by half the radius of the pie chart:

plot(plot::Piechart2d([1, 2, 1, 3], 
                      Moves = [3 = 0.5]))

The pieces are moved away from the center by different amounts:

plot(plot::Piechart2d([1, 2, 1, 3], 
                      Moves = [0, 0.5, 0.2, 0.1]))

Example 2

We plot an analogeous 3D pie chart:

plot(plot::Piechart3d([1, 2, 1, 3], 
                      Moves = [3 = 0.5]))

The pieces are moved away from the center by different amounts:

plot(plot::Piechart3d([1, 2, 1, 3], 
                      Moves = [0, 0.5, 0.2, 0.1]))

In 3D, the pieces of a pie chart can have different heights:

plot(plot::Piechart3d([1, 2, 1, 3], 
                      Heights = [0.4, 0.5, 0.2, 0.1]))

Example 3

Here is a plot::Piechart3d with animated Heights, Moves, and Radius:

plot(plot::Piechart3d([4, 3, 2, 1], 
                      Radius = 3 + sin(a),
                      Heights = [cos(a)^2, cos(2*a)^2, 
                                 cos(3*a)^2, cos(4*a)^2],
                      Moves = [0.3*sin(a)^2], a = 0..PI)):

See Also

MuPAD Functions