TreeMap - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim


Statistics

  

TreeMap

  

generate tree maps

 

Calling Sequence

Parameters

Description

Options

Examples

Compatibility

Calling Sequence

TreeMap(X, options, plotoptions)

Parameters

X

-

data

options

-

(optional) equation(s) of the form option=value where option is one of color or datasetlabels; specify options for generating the tree map

plotoptions

-

options to be passed to the plots[display] command

Description

• 

The TreeMap command generates a tree map for the specified data. A tree map is a method of data visualization using nested rectangles, in which the area of a rectangle corresponds to the the magnitude of the corresponding datum.

• 

The first parameter X is a list or Vector of equations; the left-hand side of each equation specifies a value and the right-hand side the associated frequency.

• 

The right-hand side of an input equation can also contain another list or Vector of values; this imposes a hierarchical ordering on the data.

Options

  

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.

• 

color=name, list, or range

  

This option specifies colors for the individual data sets. When a list of colors is given, each of the rectangles will be colored with the corresponding color in the list. If a range of colors is given, the colors will be generated by selecting an appropriate number of equally spaced points in the corresponding hue range.

• 

datasetlabels=default, none, relative, absolute, or list

  

This option controls data set labels on the tree map rectangles. By default, TreeMap uses data values as labels. The relative option will display, for each rectangle, the percentage value that rectangle occupies in the overall rectangle. The absolute option will display, for each rectangle, the absolute frequency of the corresponding value. Finally, one can specify data set labels as a list of strings.

Examples

withStatistics:

TreeMapA=6,B=6,D=4,E=3,F=2,G=2,H=1

View the character frequencies in the word honorificabilitudinitatibus.

TStringTools:-CharacterFrequencieshonorificabilitudinitatibus

Ta=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

(1)

TreeMapT,color=Crimson..Gold

View a list of available food items, classified into categories and displayed accordingly.

TreeMapFruits=Apples=2,Bananas=2,Oranges=5,Vegetables=Carrots=3,Potatoes=3,Eggs=12

View the relative populations of the provinces and territories of Canada.

CanadaPopulationAB=4121.7,BC=4631.3,NL=527.0,PE=146.3,MB=1282.0,NB=753.9,NT=43.6,NS=942.7,NU=36.6,ON=13678.7,QC=8214.7,SK=1125.4,YT=36.5:

TreeMapCanadaPopulation,color=blue..red,size=900,400

View the relative size of files in the videos folder installed with Maple.

withFileTools:

VideoListSizeJoinPathvideos,base=datadir,recursive,depth=1

VideoList/maple/cbat/active/268342/data/videos/videoplayer.mp4=3343432,/maple/cbat/active/268342/data/videos/world.mp4=3139798

(2)

VideoListevalindetsVideoList,string,Filename

VideoListvideoplayer.mp4=3343432,world.mp4=3139798

(3)

TreeMapVideoList

Compatibility

• 

The Statistics[TreeMap] command was introduced in Maple 2015.

• 

For more information on Maple 2015 changes, see Updates in Maple 2015.

See Also

Statistics

Statistics/Visualization

Statistics[AreaChart]

Statistics[PieChart]