Skip to content

Commit 4861716

Browse files
committed
import graph_objs as go; Data([]) to []
1 parent c4712da commit 4861716

File tree

115 files changed

+888
-888
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

115 files changed

+888
-888
lines changed

_posts/python/3d-clusters/2015-07-15-alpha-shape.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
name: 3d clustering<br>with alpha shapes
3-
plot_url: https://plot.ly/~jackp/9315/
3+
plot_url: https://plot.ly/~PlotBot/768
44
language: python
55
suite: 3d-clusters
66
order: 0

_posts/python/3d-filled-line/2015-04-09-3d-filled-line.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
name: 3D Filled Line Plot
3-
plot_url: https://plot.ly/~etpinard/5568
3+
plot_url: https://plot.ly/~PlotBot/770
44
language: python
55
suite: 3d-filled-line
66
order: 0
Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
---
22
name: Parametric Plot
3-
plot_url: https://plot.ly/~neda/7324/parametric-plot/
3+
plot_url: https://plot.ly/~PlotBot/858
44
language: python
55
suite: 3d-parametric
66
order: 0
77
sitemap: false
88
---
99
import plotly.plotly as py
10-
from plotly.graph_objs import *
10+
import plotly.graph_objs as go
1111

1212
import numpy as np
1313

@@ -20,25 +20,25 @@
2020
y = r * np.sin(sGrid) * np.sin(tGrid) # y = r*sin(s)*sin(t)
2121
z = r * np.cos(tGrid) # z = r*cos(t)
2222

23-
surface = Surface(x=x, y=y, z=z)
24-
data = Data([surface])
23+
surface = go.Surface(x=x, y=y, z=z)
24+
data = [surface]
2525

26-
layout = Layout(
26+
layout = go.Layout(
2727
title='Parametric Plot',
28-
scene=Scene(
29-
xaxis=XAxis(
28+
scene=dict(
29+
xaxis=dict(
3030
gridcolor='rgb(255, 255, 255)',
3131
zerolinecolor='rgb(255, 255, 255)',
3232
showbackground=True,
3333
backgroundcolor='rgb(230, 230,230)'
3434
),
35-
yaxis=YAxis(
35+
yaxis=dict(
3636
gridcolor='rgb(255, 255, 255)',
3737
zerolinecolor='rgb(255, 255, 255)',
3838
showbackground=True,
3939
backgroundcolor='rgb(230, 230,230)'
4040
),
41-
zaxis=ZAxis(
41+
zaxis=dict(
4242
gridcolor='rgb(255, 255, 255)',
4343
zerolinecolor='rgb(255, 255, 255)',
4444
showbackground=True,
@@ -47,5 +47,5 @@
4747
)
4848
)
4949

50-
fig = Figure(data=data, layout=layout)
50+
fig = go.Figure(data=data, layout=layout)
5151
plot_url = py.plot(fig, filename='Parametric_plot')

_posts/python/3d-ribbon/2015-07-15-ribbon.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
name: Ribbon Plot
3-
plot_url: https://plot.ly/~jackp/9269
3+
plot_url: https://raw.githubusercontent.com/plotly/datasets/master/spectral.csv
44
language: python
55
suite: 3d-ribbon
66
order: 0
@@ -9,7 +9,7 @@
99
import numpy as np
1010
import urllib
1111
import plotly.plotly as py
12-
from plotly.graph_objs import *
12+
import plotly.graph_objs as go
1313

1414
url = "https://raw.githubusercontent.com/plotly/datasets/master/spectral.csv"
1515
f = urllib.urlopen(url)

_posts/python/3d-subplot/2015-08-21-3d-subplots.html

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
---
22
name: 3D Subplots
3-
plot_url: https://plot.ly/~neda/7550/subplots-with-different-colorscales/
3+
plot_url: https://plot.ly/~PlotBot/900
44
language: python
55
suite: 3d-subplots
66
order: 0
77
sitemap: false
88
---
99

1010
import plotly.plotly as py
11-
from plotly.graph_objs import *
11+
import plotly.graph_objs as go
1212
from plotly import tools
1313

1414
import numpy as np
@@ -18,20 +18,20 @@
1818
xGrid, yGrid = np.meshgrid(y, x)
1919
z = xGrid ** 3 + yGrid ** 3
2020

21-
scene = Scene(
22-
xaxis=XAxis(
21+
scene = dict(
22+
xaxis=dict(
2323
gridcolor='rgb(255, 255, 255)',
2424
zerolinecolor='rgb(255, 255, 255)',
2525
showbackground=True,
2626
backgroundcolor='rgb(230, 230,230)'
2727
),
28-
yaxis=YAxis(
28+
yaxis=dict(
2929
gridcolor='rgb(255, 255, 255)',
3030
zerolinecolor='rgb(255, 255, 255)',
3131
showbackground=True,
3232
backgroundcolor='rgb(230, 230,230)'
3333
),
34-
zaxis=ZAxis(
34+
zaxis=dict(
3535
gridcolor='rgb(255, 255, 255)',
3636
zerolinecolor='rgb(255, 255, 255)',
3737
showbackground=True,

_posts/python/annotations/2015-04-09-multiple-annotation.html

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,43 +10,43 @@
1010
# Find your api_key here: https://plot.ly/settings/api
1111

1212
import plotly.plotly as py
13-
from plotly.graph_objs import *
13+
import plotly.graph_objs as go
1414

15-
trace1 = Scatter(
15+
trace1 = go.Scatter(
1616
x=[0, 1, 2, 3, 4, 5, 6, 7, 8],
1717
y=[0, 1, 3, 2, 4, 3, 4, 6, 5]
1818
)
19-
trace2 = Scatter(
19+
trace2 = go.Scatter(
2020
x=[0, 1, 2, 3, 4, 5, 6, 7, 8],
2121
y=[0, 4, 5, 1, 2, 2, 3, 4, 2]
2222
)
23-
data = Data([trace1, trace2])
24-
layout = Layout(
23+
data = [trace1, trace2]
24+
layout = go.Layout(
2525
showlegend=False,
26-
annotations=Annotations([
27-
Annotation(
26+
annotations=[
27+
dict(
2828
x=2,
2929
y=5,
3030
xref='x',
3131
yref='y',
32-
text='Annotation Text',
32+
text='dict Text',
3333
showarrow=True,
3434
arrowhead=7,
3535
ax=0,
3636
ay=-40
3737
),
38-
Annotation(
38+
dict(
3939
x=4,
4040
y=4,
4141
xref='x',
4242
yref='y',
43-
text='Annotation Text 2',
43+
text='dict Text 2',
4444
showarrow=True,
4545
arrowhead=7,
4646
ax=0,
4747
ay=-40
4848
)
49-
])
49+
]
5050
)
51-
fig = Figure(data=data, layout=layout)
51+
fig = go.Figure(data=data, layout=layout)
5252
plot_url = py.plot(fig, filename='multiple-annotation')

_posts/python/annotations/2015-04-09-simple-annotation.html

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,32 +10,32 @@
1010
# Find your api_key here: https://plot.ly/settings/api
1111

1212
import plotly.plotly as py
13-
from plotly.graph_objs import *
13+
import plotly.graph_objs as go
1414

15-
trace1 = Scatter(
15+
trace1 = go.Scatter(
1616
x=[0, 1, 2, 3, 4, 5, 6, 7, 8],
1717
y=[0, 1, 3, 2, 4, 3, 4, 6, 5]
1818
)
19-
trace2 = Scatter(
19+
trace2 = go.Scatter(
2020
x=[0, 1, 2, 3, 4, 5, 6, 7, 8],
2121
y=[0, 4, 5, 1, 2, 2, 3, 4, 2]
2222
)
23-
data = Data([trace1, trace2])
24-
layout = Layout(
23+
data = [trace1, trace2]
24+
layout = go.Layout(
2525
showlegend=False,
26-
annotations=Annotations([
27-
Annotation(
26+
annotations=[
27+
dict(
2828
x=2,
2929
y=5,
3030
xref='x',
3131
yref='y',
32-
text='Annotation Text',
32+
text='dict Text',
3333
showarrow=True,
3434
arrowhead=7,
3535
ax=0,
3636
ay=-40
3737
)
38-
])
38+
]
3939
)
40-
fig = Figure(data=data, layout=layout)
40+
fig = go.Figure(data=data, layout=layout)
4141
plot_url = py.plot(fig, filename='simple-annotation')

_posts/python/annotations/2015-04-09-text-chart-basic.html

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,35 +10,35 @@
1010
# Find your api_key here: https://plot.ly/settings/api
1111

1212
import plotly.plotly as py
13-
from plotly.graph_objs import *
13+
import plotly.graph_objs as go
1414

15-
trace1 = Scatter(
15+
trace1 = go.Scatter(
1616
x=[0, 1, 2],
1717
y=[1, 1, 1],
1818
mode='lines+markers+text',
1919
name='Lines, Markers and Text',
2020
text=['Text A', 'Text B', 'Text C'],
2121
textposition='top'
2222
)
23-
trace2 = Scatter(
23+
trace2 = go.Scatter(
2424
x=[0, 1, 2],
2525
y=[2, 2, 2],
2626
mode='markers+text',
2727
name='Markers and Text',
2828
text=['Text D', 'Text E', 'Text F'],
2929
textposition='bottom'
3030
)
31-
trace3 = Scatter(
31+
trace3 = go.Scatter(
3232
x=[0, 1, 2],
3333
y=[3, 3, 3],
3434
mode='lines+text',
3535
name='Lines and Text',
3636
text=['Text G', 'Text H', 'Text I'],
3737
textposition='bottom'
3838
)
39-
data = Data([trace1, trace2, trace3])
40-
layout = Layout(
39+
data = [trace1, trace2, trace3]
40+
layout = go.Layout(
4141
showlegend=False
4242
)
43-
fig = Figure(data=data, layout=layout)
43+
fig = go.Figure(data=data, layout=layout)
4444
plot_url = py.plot(fig, filename='text-chart-basic')

_posts/python/annotations/2015-04-09-text-chart-styling.html

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,37 +10,37 @@
1010
# Find your api_key here: https://plot.ly/settings/api
1111

1212
import plotly.plotly as py
13-
from plotly.graph_objs import *
13+
import plotly.graph_objs as go
1414

15-
trace1 = Scatter(
15+
trace1 = go.Scatter(
1616
x=[0, 1, 2],
1717
y=[1, 1, 1],
1818
mode='lines+markers+text',
1919
name='Lines, Markers and Text',
2020
text=['Text A', 'Text B', 'Text C'],
2121
textposition='top right',
22-
textfont=Font(
22+
textfont=dict(
2323
family='sans serif',
2424
size=18,
2525
color='#1f77b4'
2626
)
2727
)
28-
trace2 = Scatter(
28+
trace2 = go.Scatter(
2929
x=[0, 1, 2],
3030
y=[2, 2, 2],
3131
mode='lines+markers+text',
3232
name='Lines and Text',
3333
text=['Text G', 'Text H', 'Text I'],
3434
textposition='bottom',
35-
textfont=Font(
35+
textfont=dict(
3636
family='sans serif',
3737
size=18,
3838
color='#ff7f0e'
3939
)
4040
)
41-
data = Data([trace1, trace2])
42-
layout = Layout(
41+
data = [trace1, trace2]
42+
layout = go.Layout(
4343
showlegend=False
4444
)
45-
fig = Figure(data=data, layout=layout)
45+
fig = go.Figure(data=data, layout=layout)
4646
plot_url = py.plot(fig, filename='text-chart-styling')

_posts/python/annotations/2015-06-29-disable-hover.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
name: Disabling Hover Text
3-
plot_url: https://plot.ly/~chris/10109/
3+
plot_url: https://plot.ly/~PlotBot/776
44
language: python
55
suite: annotations
66
order: 6
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
name: Overlaid Area Chart Without Boundary Lines
3-
plot_url: https://plot.ly/~neda/69
3+
plot_url: https://plot.ly/~PlotBot/42
44
language: python
55
suite: area
66
order: 2
@@ -10,19 +10,19 @@
1010
# Find your api_key here: https://plot.ly/settings/api
1111

1212
import plotly.plotly as py
13-
from plotly.graph_objs import *
13+
import plotly.graph_objs as go
1414

15-
trace1 = Scatter(
15+
trace1 = go.Scatter(
1616
x=[1, 2, 3, 4],
1717
y=[0, 2, 3, 5],
1818
fill='tozeroy',
1919
mode= 'none'
2020
)
21-
trace2 = Scatter(
21+
trace2 = go.Scatter(
2222
x=[1, 2, 3, 4],
2323
y=[3, 5, 1, 7],
2424
fill='tonexty',
2525
mode= 'none'
2626
)
27-
data = Data([trace1, trace2])
27+
data = [trace1, trace2]
2828
plot_url = py.plot(data, filename='basic-area')

_posts/python/area/2015-04-09-basic-area.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,17 @@
1010
# Find your api_key here: https://plot.ly/settings/api
1111

1212
import plotly.plotly as py
13-
from plotly.graph_objs import *
13+
import plotly.graph_objs as go
1414

15-
trace1 = Scatter(
15+
trace1 = go.Scatter(
1616
x=[1, 2, 3, 4],
1717
y=[0, 2, 3, 5],
1818
fill='tozeroy'
1919
)
20-
trace2 = Scatter(
20+
trace2 = go.Scatter(
2121
x=[1, 2, 3, 4],
2222
y=[3, 5, 1, 7],
2323
fill='tonexty'
2424
)
25-
data = Data([trace1, trace2])
25+
data = [trace1, trace2]
2626
plot_url = py.plot(data, filename='basic-area')

0 commit comments

Comments
 (0)