Skip to content

Commit 1bc7ebd

Browse files
committed
Site updated at 2015-08-01 03:27:38 UTC
1 parent 47aa2c8 commit 1bc7ebd

File tree

746 files changed

+1592658
-2232991
lines changed

Some content is hidden

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

746 files changed

+1592658
-2232991
lines changed
Lines changed: 13 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
1-
// Learn about API authentication here: https://plot.ly/nodejs/getting-started
2-
// Find your api_key here: https://plot.ly/settings/api
3-
41
var x0 = [];
52
var y0 = [];
63
var x1 = [];
74
var y1 = [];
8-
95
for (var i = 0; i < 500; i ++) {
106
x0[i] = Math.random() / 5 * 0.5;
117
y0[i] = Math.random() / 5 * 0.5;
@@ -19,35 +15,30 @@
1915
var x = [x0, x1]
2016
var y = [y0, y1]
2117

22-
require('plotly')(username, api_key);
23-
2418
var trace1 = {
25-
x: x0,
26-
y: y0,
27-
mode: "markers",
19+
x: x0,
20+
y: y0,
21+
mode: "markers",
2822
marker: {
29-
symbol: "circle",
23+
symbol: "circle",
3024
opacity: 0.7
31-
},
25+
},
3226
type: "scatter"
3327
};
3428
var trace2 = {
35-
x: x1,
36-
y: y1,
37-
mode: "markers",
29+
x: x1,
30+
y: y1,
31+
mode: "markers",
3832
marker: {
39-
symbol: "square",
33+
symbol: "square",
4034
opacity: 0.7
41-
},
35+
},
4236
type: "scatter"
4337
};
4438
var trace3 = {
45-
x: x,
46-
y: y,
39+
x: x,
40+
y: y,
4741
type: "histogram2d"
4842
};
4943
var data = [trace1, trace2, trace3];
50-
var graphOptions = {filename: "2d-histogram-scatter", fileopt: "overwrite"};
51-
plotly.plot(data, graphOptions, function (err, msg) {
52-
console.log(msg);
53-
});
44+
Plotly.plot("myDiv", data);

2015/04/09/2d-histogram.html

Lines changed: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,14 @@
1-
# Learn about API authentication here: https://plot.ly/julia/getting-started
2-
# Find your api_key here: https://plot.ly/settings/api
3-
4-
using Plotly
5-
6-
x = randn(500)
7-
y = randn(500)+1
8-
9-
10-
data = [
11-
[
12-
"x" => x,
13-
"y" => y,
14-
"type" => "histogram2d"
15-
]
16-
]
17-
response = Plotly.plot(data, ["filename" => "2d-histogram", "fileopt" => "overwrite"])
18-
plot_url = response["url"]
1+
% Learn about API authentication here: https://plot.ly/matlab/getting-started
2+
% Find your api_key here: https://plot.ly/settings/api
3+
4+
x = randn(500,1);
5+
y = randn(500,1)+1;
6+
7+
data = {...
8+
struct(...
9+
'x', x, ...
10+
'y', y, ...
11+
'type', 'histogram2d')...
12+
};
13+
response = plotly(data, struct('filename', '2d-histogram', 'fileopt', 'overwrite'));
14+
plot_url = response.url
Lines changed: 92 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -1,77 +1,95 @@
1-
# Learn about API authentication here: https://plot.ly/r/getting-started
2-
# Find your api_key here: https://plot.ly/settings/api
1+
// from http://bl.ocks.org/mbostock/4349187
2+
// Sample from a normal distribution with mean 0, stddev 1.
3+
function normal() {
4+
var x = 0,
5+
y = 0,
6+
rds, c;
7+
do {
8+
x = Math.random() * 2 - 1;
9+
y = Math.random() * 2 - 1;
10+
rds = x * x + y * y;
11+
} while (rds == 0 || rds > 1);
12+
c = Math.sqrt(-2 * Math.log(rds) / rds); // Box-Muller transform
13+
return x * c; // throw away extra sample y * c
14+
}
315

4-
library(plotly)
16+
var N = 2000,
17+
a = -1,
18+
b = 1.2;
519

6-
t = seq(-1, 1.2, length=2000)
7-
x = t^3+0.3*rnorm(2000)
8-
y = t^6+0.3*rnorm(2000)
20+
var step = (b - a) / (N - 1);
21+
var t = new Array(N), x = new Array(N), y = new Array(N);
922

10-
trace1 <- list(
11-
x = x,
12-
y = y,
13-
mode = "markers",
14-
name = "points",
15-
marker = list(
16-
color = "rgb(102,0,0)",
17-
size = 2,
18-
opacity = 0.4
19-
),
20-
type = "scatter"
21-
)
22-
trace2 <- list(
23-
x = x,
24-
y = y,
25-
name = "density",
26-
ncontours = 20,
27-
colorscale = "Hot",
28-
reversescale = TRUE,
29-
showscale = FALSE,
30-
type = "histogram2dcontour"
31-
)
32-
trace3 <- list(
33-
x = x,
34-
name = "x density",
35-
marker = list(color = "rgb(102,0,0)"),
36-
yaxis = "y2",
37-
type = "histogram"
38-
)
39-
trace4 <- list(
40-
y = y,
41-
name = "y density",
42-
marker = list(color = "rgb(102,0,0)"),
43-
xaxis = "x2",
44-
type = "histogram"
45-
)
46-
data <- list(trace1, trace2, trace3, trace4)
47-
layout <- list(
48-
showlegend = FALSE,
49-
autosize = FALSE,
50-
width = 600,
51-
height = 550,
52-
xaxis = list(
53-
domain = c(0, 0.85),
54-
showgrid = FALSE,
55-
zeroline = FALSE
56-
),
57-
yaxis = list(
58-
domain = c(0, 0.85),
59-
showgrid = FALSE,
60-
zeroline = FALSE
61-
),
62-
margin = list(t = 50),
63-
hovermode = "closest",
64-
bargap = 0,
65-
xaxis2 = list(
66-
domain = c(0.85, 1),
67-
showgrid = FALSE,
68-
zeroline = FALSE
69-
),
70-
yaxis2 = list(
71-
domain = c(0.85, 1),
72-
showgrid = FALSE,
73-
zeroline = FALSE
74-
)
75-
)
76-
response <- py$plotly(data, kwargs=list(layout=layout, filename="2dhistogram-contour-subplots", fileopt="overwrite"))
77-
url <- response$url
23+
for(var i = 0; i < N; i++){
24+
t[i] = a + step * i;
25+
x[i] = (Math.pow(t[i], 3)) + (0.3 * normal() );
26+
y[i] = (Math.pow(t[i], 6)) + (0.3 * normal() );
27+
}
28+
29+
var trace1 = {
30+
x: x,
31+
y: y,
32+
mode: "markers",
33+
name: "points",
34+
marker: {
35+
color: "rgb(102,0,0)",
36+
size: 2,
37+
opacity: 0.4
38+
},
39+
type: "scatter"
40+
};
41+
var trace2 = {
42+
x: x,
43+
y: y,
44+
name: "density",
45+
ncontours: 20,
46+
colorscale: "Hot",
47+
reversescale: true,
48+
showscale: false,
49+
type: "histogram2dcontour"
50+
};
51+
var trace3 = {
52+
x: x,
53+
name: "x density",
54+
marker: {color: "rgb(102,0,0)"},
55+
yaxis: "y2",
56+
type: "histogram"
57+
};
58+
var trace4 = {
59+
y: y,
60+
name: "y density",
61+
marker: {color: "rgb(102,0,0)"},
62+
xaxis: "x2",
63+
type: "histogram"
64+
};
65+
var data = [trace1, trace2, trace3, trace4];
66+
var layout = {
67+
showlegend: false,
68+
autosize: false,
69+
width: 600,
70+
height: 550,
71+
margin: {t: 50},
72+
hovermode: "closest",
73+
bargap: 0,
74+
xaxis: {
75+
domain: [0, 0.85],
76+
showgrid: false,
77+
zeroline: false
78+
},
79+
yaxis: {
80+
domain: [0, 0.85],
81+
showgrid: false,
82+
zeroline: false
83+
},
84+
xaxis2: {
85+
domain: [0.85, 1],
86+
showgrid: false,
87+
zeroline: false
88+
},
89+
yaxis2: {
90+
domain: [0.85, 1],
91+
showgrid: false,
92+
zeroline: false
93+
}
94+
};
95+
Plotly.plot("myDiv", data, layout);

2015/04/09/Blackbody-heatmap.html

Lines changed: 16 additions & 11 deletions
Large diffs are not rendered by default.

2015/04/09/Earth-heatmap.html

Lines changed: 11 additions & 16 deletions
Large diffs are not rendered by default.

2015/04/09/Electric-heatmap.html

Lines changed: 16 additions & 9 deletions
Large diffs are not rendered by default.

2015/04/09/Greens-heatmap.html

Lines changed: 12 additions & 9 deletions
Large diffs are not rendered by default.

2015/04/09/Greys-heatmap.html

Lines changed: 9 additions & 16 deletions
Large diffs are not rendered by default.

2015/04/09/Hot-heatmap.html

Lines changed: 11 additions & 14 deletions
Large diffs are not rendered by default.

2015/04/09/Picnic-heatmap.html

Lines changed: 16 additions & 11 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)