Seaborn¤
The seaborn
submodule contains methods of producing visualizations using the Seaborn visualization library.
The seaborn
submodule contains components for generating word clouds and cluster analysis plots.
Seaborn Clustermaps¤
lexos.visualization.seaborn.cluster.clustermap.ClusterMap
¤
ClusterMap.
Source code in lexos\visualization\seaborn\cluster\clustermap.py
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 |
|
__init__(dtm, z_score=1, labels=None, pivot_kws=None, method='average', metric='euclidean', standard_scale=None, figsize=(8, 8), cbar_kws=None, row_cluster=True, col_cluster=True, row_linkage=None, col_linkage=None, row_colors=None, col_colors=None, mask=None, dendrogram_ratio=(0.1, 0.2), colors_ratio=0.03, cbar_pos=(0.02, 0.32, 0.03, 0.2), tree_kws=None, center=0, cmap='vlag', linewidths=0.75, show=False, title=None)
¤
Initialize the ClusterMap object.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
dtm |
Any
|
The data to cluster. |
required |
z_score |
int
|
The z-score to use. Defaults to 1. |
1
|
labels |
List[str]
|
The labels to use. Defaults to None. |
None
|
pivot_kws |
Dict[str, str]
|
The pivot kwargs. Defaults to None. |
None
|
method |
str
|
The method to use. Defaults to "average". |
'average'
|
metric |
str
|
The metric to use. Defaults to "euclidean". |
'euclidean'
|
standard_scale |
int
|
The standard scale to use. Defaults to None. |
None
|
figsize |
tuple
|
The figure size to use. Defaults to (8, 8). |
(8, 8)
|
cbar_kws |
dict
|
The cbar kwargs. Defaults to None. |
None
|
row_cluster |
bool
|
Whether to cluster the rows. Defaults to True. |
True
|
col_cluster |
bool
|
Whether to cluster the columns. Defaults to True. |
True
|
row_linkage |
bool
|
Whether to use row linkage. Defaults to None. |
None
|
col_linkage |
bool
|
Whether to use column linkage. Defaults to None. |
None
|
row_colors |
Union[list, pd.DataFrame, pd.Series]
|
The row colors. Defaults to None. |
None
|
col_colors |
Union[list, pd.DataFrame, pd.Series]
|
The column colors. Defaults to None. |
None
|
mask |
Union[np.ndarray, pd.DataFrame]
|
The mask to use. Defaults to None. |
None
|
dendrogram_ratio |
Union[float, Tuple[float]]
|
The dendrogram ratio to use. Defaults to (.1, .2). |
(0.1, 0.2)
|
colors_ratio |
float
|
The colors ratio to use. Defaults to 0.03. |
0.03
|
cbar_pos |
Tuple[str]
|
The cbar position to use. Defaults to (.02, .32, .03, .2). |
(0.02, 0.32, 0.03, 0.2)
|
tree_kws |
dict
|
The tree kwargs. Defaults to None. |
None
|
center |
int
|
The center to use. Defaults to 0. |
0
|
cmap |
str
|
The cmap to use. Defaults to "vlag". |
'vlag'
|
linewidths |
float
|
The linewidths to use. Defaults to .75. |
0.75
|
show |
bool
|
Whether to show the figure. Defaults to False. |
False
|
title |
str
|
The title to use. Defaults to None. |
None
|
Returns:
Type | Description |
---|---|
figure.Figure
|
matplotlib.figure.Figure: The figure. |
Source code in lexos\visualization\seaborn\cluster\clustermap.py
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 |
|
build()
¤
Build the clustermap.
Source code in lexos\visualization\seaborn\cluster\clustermap.py
105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 |
|
savefig(filename)
¤
Show the figure if it is hidden.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
filename |
str
|
The name of the file to save. |
required |
Source code in lexos\visualization\seaborn\cluster\clustermap.py
165 166 167 168 169 170 171 |
|
showfig()
¤
Show the figure if it is hidden.
This is a helper method. You can also reference the figure
using ClusterMap.fig
. This will generally display in a
Jupyter notebook.
Source code in lexos\visualization\seaborn\cluster\clustermap.py
173 174 175 176 177 178 179 180 |
|