Close
Close window
HeatMap - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Mozilla Firefox.
Maplesoft logo
Maplesoft logo

Online Help

All Products Maple MapleSim


[フレーム] [フレーム]

Statistics

HeatMap

generate heat maps

Calling Sequence

HeatMap(A, options, plotoptions)

Parameters

A

-

data

options

-

(optional) equation(s) of the form option=value where option is one of color, range, 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. All unrecognized options will be passed to the plots[display] command. 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 is 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 is 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

Meaning

Example

range=all

To all data

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

range=all

range=a..b

To 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 are 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 heat map for a random matrix.

>

RMLinearAlgebra:-RandomMatrix10:

The command to create the plot from the Plotting Guide using the data above is

>

HeatMapRM

Generate the same heat map, 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.116741765087288−0.354242435105134−0.1167417650872881.0.0701662833942683−0.3542424351051340.07016628339426831.

(1)
>

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

Compare intensities of absolute crime numbers for Canadian provinces.

>

CanadaCrimeImportdatasets/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,voda

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

(2)
>

WordDistancesDataFrameMatrixnumelemsWords,i,jStringTools:−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 .


Download Help Document

AltStyle によって変換されたページ (->オリジナル) /