Statistics - Maple Programming Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Statistics and Data Analysis : Statistics Package : Visualization : Statistics/HeatMap

Statistics

  

HeatMap

  

generate heat maps

 

Calling Sequence

Parameters

Options

Description

Examples

Compatibility

Calling Sequence

HeatMap(A, options, plotoptions)

Parameters

A

-

data

options

-

(optional) equation(s) of the form option=value where option is one of color, rowlabels, or columnlabels; specify options for generating the heat map

plotoptions

-

options to be passed to the plots[display] command

Options

  

The options argument can contain one or more of the options shown below. HeatMap also accepts generic options for controlling plot display. See plot[options] for details.

• 

color : list or range; specifies colors for the individual data sets. When a range of colors is given, the color associated with a datum will be generated by interpolating between the two named colors based on the range of values in the data. For example if color=red..blue then the minimum values in the data will be red and the maximum values blue. If a list of colors is provided, the color associated with a datum will be generated by interpolating uniformly through all named colors.

• 

range : range, list of ranges, all, or bycolumn; The option range indicates that the data is to interpreted as being in a specified range and also controls whether the mapping from value to color is applied to each column independently or to the data as a whole.

Option

Coloring applies to

Meaning

Example

range=all

All data

Same color range applied to all data, range inferred from data

range=all

range=a..b

All data

Same explicit color range a..b applied to all data

range=[1..2]

range=bycolumn

Columnwise

Each column has its own color range inferred from data

range=bycolumn

range=[a..b,c..d,...]

Columnwise

Each column has its own explicit color range

range=[1..2,3..4]

  

When ranges are inferred the minimum data value and the maximum data value from the data are used. If a specified range is used and data values are outside of this range, they will be truncated to nearest endpoint of the specified range.

• 

columnlabels : list; specifies the labels corresponding to each column. The list can contain either strings or names.

• 

rowlabels : list; specifies the labels corresponding to each row. The list can contain either strings or names.

Description

• 

The HeatMap command generates a heat map for the specified data. A heat map is a method of data visualization representing the magnitude of included data as a discrete density plot.

• 

The first parameter A is a numeric Matrix, a list of lists, or a DataFrame.

Examples

withStatistics:

Generate a heatmap for a random matrix.

RMLinearAlgebra:-RandomMatrix10:

HeatMapRM

Generate the same heatmap, sampling colors from blue to white to red.

HeatMapRM,color=blue,white,red

Generate visualization to compare the correlation between three data sets.

Useq0..10:Vseqsini,i=0..10:Wseqcosi,i=0..10:

MMatrixU,V,W:

CMCorrelationMatrixM,ignore

CM1.0.1167417651013270.3542424351168500.1167417651013271.0.07016628339543250.3542424351168500.07016628339543251.

(1)

HeatMapCM,columnlabels=n,sin(n),cos(n),rowlabels=n,sin(n),cos(n)

Compare intensities of absolute crime numbers for Canadian provinces.

CanadaCrimeImportFileTools:-JoinPathdatasets/canada_crimes.csv,base=datadir:

Statistics:-HeatMapCanadaCrime1..10,..,color=white..red,size=900,300

Visualize the same crime statistics using the same color shading for all types of crime.

Statistics:-HeatMapCanadaCrime1..10,..,color=white..red,range=all,size=900,300

Compare the similarity of words for "water" in several languages using the Levenshtein distance.

Wordsacqua,agua,eau,su,Wasser,water,woda,vatten,v303255z,voda

Wordsacqua,agua,eau,su,Wasser,water,woda,vatten,v303255z,voda

(2)

WordDistancesDataFrameMatrixnumelemsWords,i,j→StringTools:-LevenshteinWordsi,Wordsj,rows=Words,columns=Words:

Statistics:-HeatMapWordDistances,size=800,400,color=blue..white,range=all

Compatibility

• 

The Statistics[HeatMap] command was introduced in Maple 2016.

• 

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

See Also

plots[listdensityplot]

Statistics

Statistics[CorrelationMatrix]

Statistics[PieChart]

Statistics[Visualization]