@@ -2453,26 +2453,45 @@ def create_dendrogram(X, orientation="bottom", labels=None,
2453
2453
2454
2454
Example 1: Simple bottom oriented dendrogram
2455
2455
```
2456
- import numpy as np
2457
-
2458
2456
import plotly.plotly as py
2459
2457
from plotly.tools import FigureFactory as FF
2460
2458
2461
- X = np.random.rand(5,5)
2459
+ import numpy as np
2460
+
2461
+ X = np.random.rand(10,10)
2462
2462
dendro = FF.create_dendrogram(X)
2463
- py.iplot (dendro, validate=False, height=300, width=1000 )
2463
+ plot_url = py.plot (dendro, filename='simple-dendrogram' )
2464
2464
2465
2465
```
2466
2466
2467
2467
Example 2: Dendrogram to put on the left of the heatmap
2468
2468
```
2469
+ import plotly.plotly as py
2470
+ from plotly.tools import FigureFactory as FF
2471
+
2472
+ import numpy as np
2473
+
2469
2474
X = np.random.rand(5,5)
2470
2475
names = ['Jack', 'Oxana', 'John', 'Chelsea', 'Mark']
2471
2476
dendro = FF.create_dendrogram(X, orientation='right', labels=names)
2477
+ dendro['layout'].update({'width':700, 'height':500})
2478
+
2479
+ py.iplot(dendro, filename='vertical-dendrogram')
2480
+ ```
2472
2481
2473
- py.iplot(dendro, validate=False, height=1000, width=300)
2482
+ Example 3: Dendrogram with Pandas
2474
2483
```
2484
+ import plotly.plotly as py
2485
+ from plotly.tools import FigureFactory as FF
2475
2486
2487
+ import numpy as np
2488
+ import pandas as pd
2489
+
2490
+ Index= ['A','B','C','D','E','F','G','H','I','J']
2491
+ df = pd.DataFrame(abs(np.random.randn(10, 10)), index=Index)
2492
+ fig = FF.create_dendrogram(df, labels=Index)
2493
+ url = py.plot(fig, filename='pandas-dendrogram')
2494
+ ```
2476
2495
"""
2477
2496
dependencies = (_scipy_imported and _scipy__spatial_imported and
2478
2497
_scipy__cluster__hierarchy_imported )
0 commit comments