-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplot-graph.py
More file actions
36 lines (35 loc) · 782 Bytes
/
Copy pathplot-graph.py
File metadata and controls
36 lines (35 loc) · 782 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import plotly.plotly as py
from plotly.graph_objs import *
py.sign_in('username', 'api_key')
trace1 = {
"name": "SF Zoo",
"type": "bar",
"x": [20, 14, 23],
"y": ["giraffes", "orangutans", "monkeys"],
"marker": {
"line": {
"color": "rgba(55, 128, 191, 1.0)",
"width": 1
},
"color": "rgba(55, 128, 191, 0.6)"
},
"orientation": "h"
}
trace2 = {
"name": "LA Zoo",
"type": "bar",
"x": [12, 18, 29],
"y": ["giraffes", "orangutans", "monkeys"],
"marker": {
"line": {
"color": "rgba(255, 153, 51, 1.0)",
"width": 1
},
"color": "rgba(255, 153, 51, 0.6)"
},
"orientation": "h"
}
data = Data([trace1, trace2])
layout = {"barmode": "stack"}
fig = Figure(data=data, layout=layout)
plot_url = py.plot(fig)