-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathplotit.py
More file actions
44 lines (42 loc) · 1.18 KB
/
Copy pathplotit.py
File metadata and controls
44 lines (42 loc) · 1.18 KB
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
37
38
39
40
41
42
43
44
import plotly.plotly as py
import plotly.graph_objs as go
import plotly.figure_factory as ff
from operator import itemgetter
def distplot(distdata,name='Basic Distplot'):
group_labels = ['distplot']
colors = ['rgb(0, 200, 200)']
fig = ff.create_distplot([distdata], group_labels,bin_size=[.4],colors=colors)
py.plot(fig, filename=name)
def barplot(baradata,name='Dot-Plot'):
ddlen = len(baradata)
botline = range(0,ddlen)
trace = go.Bar(
x = botline,
y = baradata,
name = 'markers'
)
trace1 = go.Scatter(
x = botline,
y = baradata,
mode = 'lines+markers',
name = 'lines+markers'
)
data = [trace,trace1]
py.plot(data, filename=name)
def barplotduo(baradata,name='Dot-Plot'):
ddlen = len(baradata)
botline = range(0,ddlen)
trace = go.Bar(
x = botline,
y = map(itemgetter(0),baradata),
text = map(itemgetter(1),baradata),
name = 'markers'
)
trace1 = go.Scatter(
x = botline,
y = map(itemgetter(0),baradata),
mode = 'lines+markers',
name = 'lines+markers'
)
data = [trace,trace1]
py.plot(data, filename=name)