DistanceMatrix.
plot
(cmap=None, title='')[source]¶Creates a heatmap of the dissimilarity matrix
State: Experimental as of 0.4.0.
Parameters: | cmap: str or matplotlib.colors.Colormap, optional
title: str, optional
|
---|---|
Returns: | matplotlib.figure.Figure
|
Examples
Define a dissimilarity matrix with five objects labeled A-E:
>>> from skbio.stats.distance import DissimilarityMatrix
>>> dm = DissimilarityMatrix([[0, 1, 2, 3, 4], [1, 0, 1, 2, 3],
... [2, 1, 0, 1, 2], [3, 2, 1, 0, 1],
... [4, 3, 2, 1, 0]],
... ['A', 'B', 'C', 'D', 'E'])
Plot the dissimilarity matrix as a heatmap:
>>> fig = dm.plot(cmap='Reds', title='Example heatmap')
(Source code, png)