Statistics
TreeMap
generate tree maps
Calling Sequence
Parameters
Description
Options
Examples
Compatibility
TreeMap(X, options, plotoptions)
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
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.
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.
with⁡Statistics:
TreeMap⁡A=6,B=6,D=4,E=3,F=2,G=2,H=1
View the character frequencies in the word honorificabilitudinitatibus.
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
TreeMap⁡T,color=Crimson..Gold
View a list of available food items, classified into categories and displayed accordingly.
TreeMap⁡Fruits=Apples=2,Bananas=2,Oranges=5,Vegetables=Carrots=3,Potatoes=3,Eggs=12
View the relative populations of the provinces and territories of Canada.
CanadaPopulation≔AB=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:
TreeMap⁡CanadaPopulation,color=blue..red,size=900,400
View the relative size of files in the videos folder installed with Maple.
with⁡FileTools:
VideoList≔Size⁡JoinPath⁡videos,base=datadir,recursive,depth=1
VideoList≔/maple/cbat/active/268342/data/videos/videoplayer.mp4=3343432,/maple/cbat/active/268342/data/videos/world.mp4=3139798
VideoList≔evalindets⁡VideoList,string,Filename
VideoList≔videoplayer.mp4=3343432,world.mp4=3139798
TreeMap⁡VideoList
The Statistics[TreeMap] command was introduced in Maple 2015.
For more information on Maple 2015 changes, see Updates in Maple 2015.
See Also
Statistics/Visualization
Statistics[AreaChart]
Statistics[PieChart]
Download Help Document