Skip to content

Commit f544957

Browse files
committed
Site updated at 2015-10-14 05:35:14 UTC
1 parent d23fbf6 commit f544957

File tree

134 files changed

+2448
-1922
lines changed

Some content is hidden

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

134 files changed

+2448
-1922
lines changed

2015/04/09/axes-labels.html

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,45 +2,45 @@
22
# Find your api_key here: https://plot.ly/settings/api
33

44
import plotly.plotly as py
5-
from plotly.graph_objs import *
5+
import plotly.graph_objs as go
66

7-
trace1 = Scatter(
7+
trace1 = go.Scatter(
88
x=[0, 1, 2, 3, 4, 5, 6, 7, 8],
99
y=[8, 7, 6, 5, 4, 3, 2, 1, 0]
1010
)
11-
trace2 = Scatter(
11+
trace2 = go.Scatter(
1212
x=[0, 1, 2, 3, 4, 5, 6, 7, 8],
1313
y=[0, 1, 2, 3, 4, 5, 6, 7, 8]
1414
)
15-
data = Data([trace1, trace2])
16-
layout = Layout(
17-
xaxis=XAxis(
15+
data = [trace1, trace2]
16+
layout = go.Layout(
17+
xaxis=dict(
1818
title='AXIS TITLE',
19-
titlefont=Font(
19+
titlefont=dict(
2020
family='Arial, sans-serif',
2121
size=18,
2222
color='lightgrey'
2323
),
2424
showticklabels=True,
2525
tickangle=45,
26-
tickfont=Font(
26+
tickfont=dict(
2727
family='Old Standard TT, serif',
2828
size=14,
2929
color='black'
3030
),
3131
exponentformat='e',
3232
showexponent='All'
3333
),
34-
yaxis=YAxis(
34+
yaxis=dict(
3535
title='AXIS TITLE',
36-
titlefont=Font(
36+
titlefont=dict(
3737
family='Arial, sans-serif',
3838
size=18,
3939
color='lightgrey'
4040
),
4141
showticklabels=True,
4242
tickangle=45,
43-
tickfont=Font(
43+
tickfont=dict(
4444
family='Old Standard TT, serif',
4545
size=14,
4646
color='black'
@@ -49,5 +49,5 @@
4949
showexponent='All'
5050
)
5151
)
52-
fig = Figure(data=data, layout=layout)
52+
fig = go.Figure(data=data, layout=layout)
5353
plot_url = py.plot(fig, filename='axes-labels')

2015/04/09/basic-area-without-boundary-lines.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,19 @@
22
# Find your api_key here: https://plot.ly/settings/api
33

44
import plotly.plotly as py
5-
from plotly.graph_objs import *
5+
import plotly.graph_objs as go
66

7-
trace1 = Scatter(
7+
trace1 = go.Scatter(
88
x=[1, 2, 3, 4],
99
y=[0, 2, 3, 5],
1010
fill='tozeroy',
1111
mode= 'none'
1212
)
13-
trace2 = Scatter(
13+
trace2 = go.Scatter(
1414
x=[1, 2, 3, 4],
1515
y=[3, 5, 1, 7],
1616
fill='tonexty',
1717
mode= 'none'
1818
)
19-
data = Data([trace1, trace2])
19+
data = [trace1, trace2]
2020
plot_url = py.plot(data, filename='basic-area')

2015/04/09/basic-area.html

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

44
import plotly.plotly as py
5-
from plotly.graph_objs import *
5+
import plotly.graph_objs as go
66

7-
trace1 = Scatter(
7+
trace1 = go.Scatter(
88
x=[1, 2, 3, 4],
99
y=[0, 2, 3, 5],
1010
fill='tozeroy'
1111
)
12-
trace2 = Scatter(
12+
trace2 = go.Scatter(
1313
x=[1, 2, 3, 4],
1414
y=[3, 5, 1, 7],
1515
fill='tonexty'
1616
)
17-
data = Data([trace1, trace2])
17+
data = [trace1, trace2]
1818
plot_url = py.plot(data, filename='basic-area')

2015/04/09/basic-wind-rose-chart.html

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,55 +2,55 @@
22
# Find your api_key here: https://plot.ly/settings/api
33

44
import plotly.plotly as py
5-
from plotly.graph_objs import *
5+
import plotly.graph_objs as go
66

7-
trace1 = Area(
7+
trace1 = go.Area(
88
r=[77.5, 72.5, 70.0, 45.0, 22.5, 42.5, 40.0, 62.5],
99
t=['North', 'N-E', 'East', 'S-E', 'South', 'S-W', 'West', 'N-W'],
1010
name='11-14 m/s',
11-
marker=Marker(
11+
marker=dict(
1212
color='rgb(106,81,163)'
1313
)
1414
)
15-
trace2 = Area(
15+
trace2 = go.Area(
1616
r=[57.49999999999999, 50.0, 45.0, 35.0, 20.0, 22.5, 37.5, 55.00000000000001],
1717
t=['North', 'N-E', 'East', 'S-E', 'South', 'S-W', 'West', 'N-W'],
1818
name='8-11 m/s',
19-
marker=Marker(
19+
marker=dict(
2020
color='rgb(158,154,200)'
2121
)
2222
)
23-
trace3 = Area(
23+
trace3 = go.Area(
2424
r=[40.0, 30.0, 30.0, 35.0, 7.5, 7.5, 32.5, 40.0],
2525
t=['North', 'N-E', 'East', 'S-E', 'South', 'S-W', 'West', 'N-W'],
2626
name='5-8 m/s',
27-
marker=Marker(
27+
marker=dict(
2828
color='rgb(203,201,226)'
2929
)
3030
)
31-
trace4 = Area(
31+
trace4 = go.Area(
3232
r=[20.0, 7.5, 15.0, 22.5, 2.5, 2.5, 12.5, 22.5],
3333
t=['North', 'N-E', 'East', 'S-E', 'South', 'S-W', 'West', 'N-W'],
3434
name='< 5 m/s',
35-
marker=Marker(
35+
marker=dict(
3636
color='rgb(242,240,247)'
3737
)
3838
)
39-
data = Data([trace1, trace2, trace3, trace4])
40-
layout = Layout(
39+
data = [trace1, trace2, trace3, trace4]
40+
layout = go.Layout(
4141
title='Wind Speed Distribution in Laurel, NE',
42-
font=Font(
42+
font=dict(
4343
size=16
4444
),
45-
legend=Legend(
46-
font=Font(
45+
legend=dict(
46+
font=dict(
4747
size=16
4848
)
4949
),
50-
radialaxis=RadialAxis(
50+
radialaxis=dict(
5151
ticksuffix='%'
5252
),
5353
orientation=270
5454
)
55-
fig = Figure(data=data, layout=layout)
55+
fig = go.Figure(data=data, layout=layout)
5656
plot_url = py.plot(fig, filename='polar-area-chart')

2015/04/09/datetime-heatmap.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,4 @@
3434

3535
fig = go.Figure( data=data, layout=layout )
3636

37-
url = py.plot(fig, filename='datetime-heatmap', validate=False)
37+
url = py.plot(fig, filename='datetime-heatmap')

2015/04/09/error-bar-bar.html

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,31 +2,31 @@
22
# Find your api_key here: https://plot.ly/settings/api
33

44
import plotly.plotly as py
5-
from plotly.graph_objs import *
5+
import plotly.graph_objs as go
66

7-
trace1 = Bar(
7+
trace1 = go.Bar(
88
x=['Trial 1', 'Trial 2', 'Trial 3'],
99
y=[3, 6, 4],
1010
name='Control',
11-
error_y=ErrorY(
11+
error_y=dict(
1212
type='data',
1313
array=[1, 0.5, 1.5],
1414
visible=True
1515
)
1616
)
17-
trace2 = Bar(
17+
trace2 = go.Bar(
1818
x=['Trial 1', 'Trial 2', 'Trial 3'],
1919
y=[4, 7, 3],
2020
name='Experimental',
21-
error_y=ErrorY(
21+
error_y=dict(
2222
type='data',
2323
array=[0.5, 1, 2],
2424
visible=True
2525
)
2626
)
27-
data = Data([trace1, trace2])
28-
layout = Layout(
27+
data = [trace1, trace2]
28+
layout = go.Layout(
2929
barmode='group'
3030
)
31-
fig = Figure(data=data, layout=layout)
31+
fig = go.Figure(data=data, layout=layout)
3232
plot_url = py.plot(fig, filename='error-bar-bar')

2015/04/09/golden-spiral.html

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,33 @@
11
# Learn about API authentication here: https://plot.ly/python/getting-started
22
# Find your api_key here: https://plot.ly/settings/api
33

4-
from numpy import *
4+
import numpy as np
55
import plotly.plotly as py
66

77
# Golden spiral with fibonacci rectangles
88

99
## Build the spiral
1010
def spiral(th):
1111
a = 1.120529
12-
b = 0.306349
13-
r = a*exp(-b*th)
14-
return (r*cos(th), r*sin(th))
12+
b = 0.306349
13+
r = a*np.exp(-b*th)
14+
return (r*np.cos(th), r*np.sin(th))
1515

1616
nspiral = 2 # number of spiral loops
1717

18-
th = linspace(-pi/13,2*pi*nspiral,1000); # angle
18+
th = np.linspace(-np.pi/13,2*np.pi*nspiral,1000); # angle
1919
(x,y) = spiral(th)
2020

2121
# shift the spiral north so that it is centered
22-
yshift = (1.6 - (max(y)-min(y)))/2
22+
yshift = (1.6 - (max(y)-min(y)))/2
2323

24-
s = dict(x= -x+x[0], y= y-y[0]+yshift,
24+
s = dict(x= -x+x[0], y= y-y[0]+yshift,
2525
line =dict(color='white',width=3)) # spiral
2626

2727
# Build the rectangles as a heatmap
2828
# specify the edges of the heatmap squares
29-
phi = ( 1+sqrt(5) )/2.
30-
xe = [0, 1, 1+(1/(phi**4)), 1+(1/(phi**3)), phi]
29+
phi = ( 1+np.sqrt(5) )/2.
30+
xe = [0, 1, 1+(1/(phi**4)), 1+(1/(phi**3)), phi]
3131
ye = [0, 1/(phi**3),1/phi**3+1/phi**4,1/(phi**2),1]
3232

3333
z = [ [13,3,3,5],
@@ -36,24 +36,24 @@
3636
[13,8,8,8]
3737
]
3838

39-
hm = dict(x = sort(xe),
40-
y = sort(ye)+yshift,
41-
z = z,
42-
type = 'heatmap',
39+
hm = dict(x = np.sort(xe),
40+
y = np.sort(ye)+yshift,
41+
z = z,
42+
type = 'heatmap',
4343
colorscale = 'Viridis')
4444

45-
axis_template = dict(range = [0,1.6], autorange = False,
46-
showgrid = False, zeroline = False,
47-
linecolor = 'black', showticklabels = False,
45+
axis_template = dict(range = [0,1.6], autorange = False,
46+
showgrid = False, zeroline = False,
47+
linecolor = 'black', showticklabels = False,
4848
ticks = '' )
4949

5050
layout = dict( margin = dict(t=200,r=200,b=200,l=200),
5151
xaxis = axis_template,
5252
yaxis = axis_template,
5353
showlegend = False,
54-
width = 700, height = 700,
54+
width = 700, height = 700,
5555
autosize = False )
5656

5757
figure = dict(data=[s, hm],layout=layout)
5858

59-
url = py.plot(figure, filename='golden spiral', height=750)
59+
url = py.plot(figure, filename='golden spiral', height=750)

2015/04/09/legend-inside.html

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,23 @@
22
# Find your api_key here: https://plot.ly/settings/api
33

44
import plotly.plotly as py
5-
from plotly.graph_objs import *
5+
import plotly.graph_objs as go
66

7-
trace1 = Scatter(
7+
trace1 = go.Scatter(
88
x=[0, 1, 2, 3, 4, 5, 6, 7, 8],
99
y=[0, 3, 6, 4, 5, 2, 3, 5, 4]
1010
)
11-
trace2 = Scatter(
11+
trace2 = go.Scatter(
1212
x=[0, 1, 2, 3, 4, 5, 6, 7, 8],
1313
y=[0, 4, 7, 8, 3, 6, 3, 3, 4]
1414
)
15-
data = Data([trace1, trace2])
16-
layout = Layout(
15+
data = [trace1, trace2]
16+
layout = go.Layout(
1717
showlegend=True,
18-
legend=Legend(
18+
legend=dict(
1919
x=0.9,
2020
y=1
2121
)
2222
)
23-
fig = Figure(data=data, layout=layout)
23+
fig = go.Figure(data=data, layout=layout)
2424
plot_url = py.plot(fig, filename='legend-inside')

2015/04/09/overlaid-histogram.html

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,23 @@
22
# Find your api_key here: https://plot.ly/settings/api
33

44
import plotly.plotly as py
5-
from plotly.graph_objs import *
5+
import plotly.graph_objs as go
66

77
import numpy as np
88
x0 = np.random.randn(500)
99
x1 = np.random.randn(500)+1
1010

11-
trace1 = Histogram(
11+
trace1 = go.Histogram(
1212
x=x0,
1313
opacity=0.75
1414
)
15-
trace2 = Histogram(
15+
trace2 = go.Histogram(
1616
x=x1,
1717
opacity=0.75
1818
)
19-
data = Data([trace1, trace2])
20-
layout = Layout(
19+
data = [trace1, trace2]
20+
layout = go.Layout(
2121
barmode='overlay'
2222
)
23-
fig = Figure(data=data, layout=layout)
23+
fig = go.Figure(data=data, layout=layout)
2424
plot_url = py.plot(fig, filename='overlaid-histogram')

0 commit comments

Comments
 (0)