Skip to content

Commit ea1b38e

Browse files
committed
Update dendrogram.md
1 parent dbf7c26 commit ea1b38e

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

doc/python/dendrogram.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ fig.show()
7979

8080
#### Plot a Dendrogram with a Heatmap
8181

82-
See also the [Dash Bio demo](https://dash-bio.plotly.host/dash-clustergram/).
82+
This example uses randomly generated sample data to demonstrate how to plot a dendrogram with a heatmap.
8383

8484
```python
8585
import plotly.graph_objects as go
@@ -89,12 +89,11 @@ import numpy as np
8989
from scipy.spatial.distance import pdist, squareform
9090

9191

92-
# get data
93-
data = np.genfromtxt("http://files.figshare.com/2133304/ExpRawData_E_TABM_84_A_AFFY_44.tab",
94-
names=True,usecols=tuple(range(1,30)),dtype=float, delimiter="\t")
95-
data_array = data.view((float, len(data.dtype.names)))
96-
data_array = data_array.transpose()
97-
labels = data.dtype.names
92+
# Generate sample data
93+
np.random.seed(1)
94+
X = np.random.rand(15, 15)
95+
labels = [f'Sample_{i}' for i in range(15)]
96+
data_array = X
9897

9998
# Initialize figure by creating upper dendrogram
10099
fig = ff.create_dendrogram(data_array, orientation='bottom', labels=labels)

0 commit comments

Comments
 (0)