Skip to content

Commit c7d1660

Browse files
committed
1 parent 3f524ec commit c7d1660

File tree

1,363 files changed

+7204
-306806
lines changed

Some content is hidden

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

1,363 files changed

+7204
-306806
lines changed

2015/04/09/brownian-motion.html

Lines changed: 11 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -1,85 +1,11 @@
1-
import plotly.plotly as py
2-
import plotly.graph_objs as go
3-
import pandas as pd
4-
import numpy as np
5-
6-
def brownian_motion(T = 1, N = 100, mu = 0.1, sigma = 0.01, S0 = 20):
7-
dt = float(T)/N
8-
t = np.linspace(0, T, N)
9-
W = np.random.standard_normal(size = N)
10-
W = np.cumsum(W)*np.sqrt(dt) # standard brownian motion
11-
X = (mu-0.5*sigma**2)*t + sigma*W
12-
S = S0*np.exp(X) # geometric brownian motion
13-
return S
14-
15-
dates = pd.date_range('2012-01-01', '2013-02-22')
16-
T = (dates.max()-dates.min()).days / 365
17-
N = dates.size
18-
start_price = 100
19-
y = pd.Series(
20-
brownian_motion(T, N, sigma=0.1, S0=start_price), index=dates)
21-
z = pd.Series(
22-
brownian_motion(T, N, sigma=0.1, S0=start_price), index=dates)
23-
24-
trace = go.Scatter3d(
25-
x=dates, y=y, z=z,
26-
marker=dict(
27-
size=4,
28-
color=z,
29-
colorscale='Viridis',
30-
),
31-
line=dict(
32-
color='#1f77b4',
33-
width=1
34-
)
35-
)
36-
37-
data = [trace]
38-
39-
layout = dict(
40-
width=800,
41-
height=700,
42-
autosize=False,
43-
title='Brownian Motion Instance',
44-
scene=dict(
45-
xaxis=dict(
46-
gridcolor='rgb(255, 255, 255)',
47-
zerolinecolor='rgb(255, 255, 255)',
48-
showbackground=True,
49-
backgroundcolor='rgb(230, 230,230)'
50-
),
51-
yaxis=dict(
52-
gridcolor='rgb(255, 255, 255)',
53-
zerolinecolor='rgb(255, 255, 255)',
54-
showbackground=True,
55-
backgroundcolor='rgb(230, 230,230)'
56-
),
57-
zaxis=dict(
58-
gridcolor='rgb(255, 255, 255)',
59-
zerolinecolor='rgb(255, 255, 255)',
60-
showbackground=True,
61-
backgroundcolor='rgb(230, 230,230)'
62-
),
63-
camera=dict(
64-
up=dict(
65-
x=0,
66-
y=0,
67-
z=1
68-
),
69-
eye=dict(
70-
x=-1.7428,
71-
y=1.0707,
72-
z=0.7100,
73-
)
74-
),
75-
aspectratio = dict( x=1, y=1, z=0.7 ),
76-
aspectmode = 'manual'
77-
),
78-
)
79-
80-
fig = dict(data=data, layout=layout)
81-
82-
# IPython notebook
83-
# py.iplot(fig, filename='pandas-brownian-motion-3d', height=700, validate=False)
84-
85-
url = py.plot(fig, filename='pandas-brownian-motion-3d', height=700, validate=False)
1+
<!DOCTYPE html>
2+
<html lang="en-US">
3+
<meta charset="utf-8">
4+
<title>Redirecting&hellip;</title>
5+
<link rel="canonical" href="/python/">
6+
<script>location="/python/"</script>
7+
<meta http-equiv="refresh" content="0; url=/python/">
8+
<meta name="robots" content="noindex">
9+
<h1>Redirecting&hellip;</h1>
10+
<a href="/python/">Click here if you are not redirected.</a>
11+
</html>
Lines changed: 11 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,11 @@
1-
# Learn about API authentication here: https://plotly.com/python/getting-started
2-
# Find your api_key here: https://plotly.com/settings/api
3-
4-
import plotly.plotly as py
5-
import plotly.graph_objs as go
6-
7-
import pandas as pd
8-
9-
# Read data from a csv
10-
z_data = pd.read_csv('https://raw.githubusercontent.com/plotly/datasets/master/api_docs/mt_bruno_elevation.csv')
11-
12-
data = [
13-
go.Surface(
14-
z=z_data.as_matrix()
15-
)
16-
]
17-
layout = go.Layout(
18-
title='Mt Bruno Elevation',
19-
autosize=False,
20-
width=500,
21-
height=500,
22-
margin=dict(
23-
l=65,
24-
r=50,
25-
b=65,
26-
t=90
27-
)
28-
)
29-
fig = go.Figure(data=data, layout=layout)
30-
plot_url = py.plot(fig, filename='elevations-3d-surface')
1+
<!DOCTYPE html>
2+
<html lang="en-US">
3+
<meta charset="utf-8">
4+
<title>Redirecting&hellip;</title>
5+
<link rel="canonical" href="/python/">
6+
<script>location="/python/"</script>
7+
<meta http-equiv="refresh" content="0; url=/python/">
8+
<meta name="robots" content="noindex">
9+
<h1>Redirecting&hellip;</h1>
10+
<a href="/python/">Click here if you are not redirected.</a>
11+
</html>

2015/04/09/global-font.html

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,11 @@
1-
# Learn about API authentication here: https://plotly.com/python/getting-started
2-
# Find your api_key here: https://plotly.com/settings/api
3-
4-
import plotly.plotly as py
5-
import plotly.graph_objs as go
6-
7-
data = [
8-
go.Scatter(
9-
x=[0, 1, 2, 3, 4, 5, 6, 7, 8],
10-
y=[0, 1, 2, 3, 4, 5, 6, 7, 8]
11-
)
12-
]
13-
layout = go.Layout(
14-
title='Global Font',
15-
font=dict(family='Courier New, monospace', size=18, color='#7f7f7f')
16-
)
17-
fig = go.Figure(data=data, layout=layout)
18-
plot_url = py.plot(fig, filename='global-font')
1+
<!DOCTYPE html>
2+
<html lang="en-US">
3+
<meta charset="utf-8">
4+
<title>Redirecting&hellip;</title>
5+
<link rel="canonical" href="/python/">
6+
<script>location="/python/"</script>
7+
<meta http-equiv="refresh" content="0; url=/python/">
8+
<meta name="robots" content="noindex">
9+
<h1>Redirecting&hellip;</h1>
10+
<a href="/python/">Click here if you are not redirected.</a>
11+
</html>

2015/04/09/python-change_plot.html

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1-
import plotly.plotly as py
2-
# Learn about API authentication here: https://plotly.com/python/getting-started
3-
# Find your api_key here: https://plotly.com/settings/api
4-
5-
fig = py.get_figure("https://plotly.com/~PlotBot/5")
6-
7-
fig['layout']['title'] = "Never forget that title!"
8-
9-
plot_url = py.plot(fig, filename="python-change_plot")
1+
<!DOCTYPE html>
2+
<html lang="en-US">
3+
<meta charset="utf-8">
4+
<title>Redirecting&hellip;</title>
5+
<link rel="canonical" href="/python/">
6+
<script>location="/python/"</script>
7+
<meta http-equiv="refresh" content="0; url=/python/">
8+
<meta name="robots" content="noindex">
9+
<h1>Redirecting&hellip;</h1>
10+
<a href="/python/">Click here if you are not redirected.</a>
11+
</html>

2015/04/09/python-get-data.html

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
1-
import plotly.plotly as py
2-
import plotly.graph_objs as go
3-
# Learn about API authentication here: https://plotly.com/python/getting-started
4-
# Find your api_key here: https://plotly.com/settings/api
5-
6-
data = py.get_figure("https://plotly.com/~AlexHP/68").get_data()
7-
distance = [d['y'][0] for d in data] # check out the data for yourself!
8-
9-
fig = go.Figure()
10-
fig['data'] += [go.Histogram(y=distance, name="flyby distance", histnorm='probability')]
11-
xaxis = dict(title="Probability for Flyby at this Distance")
12-
yaxis = dict(title="Distance from Earth (Earth Radii)")
13-
fig['layout'].update(title="data source: https://plotly.com/~AlexHP/68", xaxis=xaxis, yaxis=yaxis)
14-
15-
plot_url = py.plot(fig, filename="python-get-data")
1+
<!DOCTYPE html>
2+
<html lang="en-US">
3+
<meta charset="utf-8">
4+
<title>Redirecting&hellip;</title>
5+
<link rel="canonical" href="/python/">
6+
<script>location="/python/"</script>
7+
<meta http-equiv="refresh" content="0; url=/python/">
8+
<meta name="robots" content="noindex">
9+
<h1>Redirecting&hellip;</h1>
10+
<a href="/python/">Click here if you are not redirected.</a>
11+
</html>

2015/04/09/python-replot1.html

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
1-
import plotly.plotly as py
2-
# Learn about API authentication here: https://plotly.com/python/getting-started
3-
# Find your api_key here: https://plotly.com/settings/api
4-
5-
fig = py.get_figure("https://plotly.com/~PlotBot/5")
6-
7-
plot_url = py.plot(fig, filename="python-replot1")
1+
<!DOCTYPE html>
2+
<html lang="en-US">
3+
<meta charset="utf-8">
4+
<title>Redirecting&hellip;</title>
5+
<link rel="canonical" href="/python/">
6+
<script>location="/python/"</script>
7+
<meta http-equiv="refresh" content="0; url=/python/">
8+
<meta name="robots" content="noindex">
9+
<h1>Redirecting&hellip;</h1>
10+
<a href="/python/">Click here if you are not redirected.</a>
11+
</html>

2015/04/09/python-replot2.html

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
1-
import plotly.plotly as py
2-
# Learn about API authentication here: https://plotly.com/python/getting-started
3-
# Find your api_key here: https://plotly.com/settings/api
4-
5-
fig = py.get_figure("PlotBot", 5)
6-
7-
plot_url = py.plot(fig, filename="python-replot2")
1+
<!DOCTYPE html>
2+
<html lang="en-US">
3+
<meta charset="utf-8">
4+
<title>Redirecting&hellip;</title>
5+
<link rel="canonical" href="/python/">
6+
<script>location="/python/"</script>
7+
<meta http-equiv="refresh" content="0; url=/python/">
8+
<meta name="robots" content="noindex">
9+
<h1>Redirecting&hellip;</h1>
10+
<a href="/python/">Click here if you are not redirected.</a>
11+
</html>

2015/07/15/alpha-shape.html

Lines changed: 11 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,11 @@
1-
import plotly.plotly as py
2-
import pandas as pd
3-
4-
df = pd.read_csv('https://raw.githubusercontent.com/plotly/datasets/master/alpha_shape.csv')
5-
df.head()
6-
7-
scatter = dict(
8-
mode = "markers",
9-
name = "y",
10-
type = "scatter3d",
11-
x = df['x'], y = df['y'], z = df['z'],
12-
marker = dict( size=2, color="rgb(23, 190, 207)" )
13-
)
14-
clusters = dict(
15-
alphahull = 7,
16-
name = "y",
17-
opacity = 0.1,
18-
type = "mesh3d",
19-
x = df['x'], y = df['y'], z = df['z']
20-
)
21-
layout = dict(
22-
title = '3d point clustering',
23-
scene = dict(
24-
xaxis = dict( zeroline=False ),
25-
yaxis = dict( zeroline=False ),
26-
zaxis = dict( zeroline=False ),
27-
)
28-
)
29-
fig = dict( data=[scatter, clusters], layout=layout )
30-
# Use py.iplot() for IPython notebook
31-
url = py.plot(fig, filename='3d point clustering')
1+
<!DOCTYPE html>
2+
<html lang="en-US">
3+
<meta charset="utf-8">
4+
<title>Redirecting&hellip;</title>
5+
<link rel="canonical" href="/python/">
6+
<script>location="/python/"</script>
7+
<meta http-equiv="refresh" content="0; url=/python/">
8+
<meta name="robots" content="noindex">
9+
<h1>Redirecting&hellip;</h1>
10+
<a href="/python/">Click here if you are not redirected.</a>
11+
</html>
Lines changed: 11 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,11 @@
1-
import plotly.plotly as py
2-
from plotly.graph_objs import Surface
3-
4-
z1 = [
5-
[8.83,8.89,8.81,8.87,8.9,8.87],
6-
[8.89,8.94,8.85,8.94,8.96,8.92],
7-
[8.84,8.9,8.82,8.92,8.93,8.91],
8-
[8.79,8.85,8.79,8.9,8.94,8.92],
9-
[8.79,8.88,8.81,8.9,8.95,8.92],
10-
[8.8,8.82,8.78,8.91,8.94,8.92],
11-
[8.75,8.78,8.77,8.91,8.95,8.92],
12-
[8.8,8.8,8.77,8.91,8.95,8.94],
13-
[8.74,8.81,8.76,8.93,8.98,8.99],
14-
[8.89,8.99,8.92,9.1,9.13,9.11],
15-
[8.97,8.97,8.91,9.09,9.11,9.11],
16-
[9.04,9.08,9.05,9.25,9.28,9.27],
17-
[9,9.01,9,9.2,9.23,9.2],
18-
[8.99,8.99,8.98,9.18,9.2,9.19],
19-
[8.93,8.97,8.97,9.18,9.2,9.18]
20-
]
21-
22-
z2 = [[zij+1 for zij in zi] for zi in z1]
23-
z3 = [[zij-1 for zij in zi] for zi in z1]
24-
25-
py.iplot([
26-
dict(z=z1, type='surface'),
27-
dict(z=z2, showscale=False, opacity=0.9, type='surface'),
28-
dict(z=z3, showscale=False, opacity=0.9, type='surface')],
29-
filename='python-docs/multiple-surfaces')
1+
<!DOCTYPE html>
2+
<html lang="en-US">
3+
<meta charset="utf-8">
4+
<title>Redirecting&hellip;</title>
5+
<link rel="canonical" href="/python/">
6+
<script>location="/python/"</script>
7+
<meta http-equiv="refresh" content="0; url=/python/">
8+
<meta name="robots" content="noindex">
9+
<h1>Redirecting&hellip;</h1>
10+
<a href="/python/">Click here if you are not redirected.</a>
11+
</html>

0 commit comments

Comments
 (0)