You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: notebooks/tree-plots.md
+27-52Lines changed: 27 additions & 52 deletions
Original file line number
Diff line number
Diff line change
@@ -1,15 +1,26 @@
1
1
---
2
2
jupyter:
3
3
jupytext:
4
+
notebook_metadata_filter: all
4
5
text_representation:
5
6
extension: .md
6
7
format_name: markdown
7
8
format_version: '1.1'
8
9
jupytext_version: 1.1.1
9
10
kernelspec:
10
-
display_name: Python 2
11
+
display_name: Python 3
11
12
language: python
12
-
name: python2
13
+
name: python3
14
+
language_info:
15
+
codemirror_mode:
16
+
name: ipython
17
+
version: 3
18
+
file_extension: .py
19
+
mimetype: text/x-python
20
+
name: python
21
+
nbconvert_exporter: python
22
+
pygments_lexer: ipython3
23
+
version: 3.6.7
13
24
plotly:
14
25
description: How to make interactive tree-plot in Python with Plotly. An examples
15
26
of a tree-plot in Plotly.
@@ -25,28 +36,15 @@ jupyter:
25
36
title: Python Tree-plots | plotly
26
37
---
27
38
28
-
#### New to Plotly?
29
-
Plotly's Python library is free and open source! [Get started](https://plot.ly/python/getting-started/) by downloading the client and [reading the primer](https://plot.ly/python/getting-started/).
30
-
<br>You can set up Plotly to work in [online](https://plot.ly/python/getting-started/#initialization-for-online-plotting) or [offline](https://plot.ly/python/getting-started/#initialization-for-offline-plotting) mode, or in [jupyter notebooks](https://plot.ly/python/getting-started/#start-plotting-online).
31
-
<br>We also have a quick-reference [cheatsheet](https://images.plot.ly/plotly-documentation/images/python_cheat_sheet.pdf) (new!) to help you get started!
32
-
39
+
#### Set Up Tree with [igraph](http://igraph.org/python/)
33
40
34
-
#### Basic Tree-Plot in Plotly with [igraph](http://igraph.org/python/)
41
+
Install igraph with `pip install python-igraph`.
35
42
36
43
```python
37
-
import plotly.plotly as py
38
-
import plotly.graph_objs as go
39
-
40
44
import igraph
41
-
from igraph import*
42
-
igraph.__version__
43
-
```
44
-
45
-
#### Set Up Tree with [igraph](http://igraph.org/python/)
46
-
47
-
```python
45
+
from igraph import Graph, EdgeSeq
48
46
nr_vertices =25
49
-
v_label =map(str, range(nr_vertices))
47
+
v_label =list(map(str, range(nr_vertices)))
50
48
G = Graph.Tree(nr_vertices, 2) # 2 stands for children number
See https://plot.ly/python/reference/ for more information and chart attribute options and http://igraph.org/python/ for more information about the igraph package!
0 commit comments