Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0e9723f

Browse files
committed
Merge branch 'source-design-merge' of https://github.com/plotly/documentation into source-design-merge
2 parents a5d53cd + 4395761 commit 0e9723f

File tree

4 files changed

+209
-10
lines changed

4 files changed

+209
-10
lines changed

_config_dev.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ plotlyjs_download_url: https://cdn.plot.ly/plotly-latest.min.js
1717
# Excludes
1818
# ---
1919
# all of the posts: ['*.Rmd','_posts/2015-09-09-matlab-reference.html','_posts/2015-09-06-r-reference.html','_posts/2015-09-06-python-reference.html','_posts/2015-08-19-plotly_js-reference.html','_posts/2015-04-05-ggplot2-index.html','_posts/2015-04-05-julia-index.html','_posts/2015-04-05-matlab-index.html','_posts/2015-04-05-matplotlib-index.html','_posts/2015-04-05-node_js-index.html','_posts/2015-04-05-plotly_js-index.html','_posts/2015-04-05-plotlyjs-function-reference.md','_posts/2015-04-05-python-index.html','_posts/2015-05-25-ipython-notebooks_gallery.html','_posts/2015-05-25-ipython-notebooks_index.html','_posts/2015-07-13-eula_index.html','_posts/2015-07-19-pandas.html','_posts/2015-07-26-index.html','_posts/2015-07-30-r-index.Rmd','_posts/2015-07-30-r-index.md','_posts/2015-08-20-research-box-index.html','_posts/ggplot2','_posts/julia','_posts/matlab','_posts/matplotlib','_posts/nodejs','_posts/pandas','_posts/plotly_js','_posts/python','_posts/r','_posts/tutorials','_posts/user_guide_matlab','_posts/user_guide_python']
20-
exclude: ['*.Rmd','_posts/2015-09-09-matlab-reference.html','_posts/2015-09-06-r-reference.html','_posts/2015-09-06-python-reference.html','_posts/2015-08-19-plotly_js-reference.html','_posts/2015-04-05-ggplot2-index.html','_posts/2015-04-05-julia-index.html','_posts/2015-04-05-matlab-index.html','_posts/2015-04-05-matplotlib-index.html','_posts/2015-04-05-node_js-index.html','_posts/2015-04-05-plotlyjs-function-reference.md','_posts/2015-04-05-python-index.html','_posts/2015-05-25-ipython-notebooks_gallery.html','_posts/2015-05-25-ipython-notebooks_index.html','_posts/2015-07-13-eula_index.html','_posts/2015-07-19-pandas.html','_posts/2015-07-26-index.html','_posts/2015-07-30-r-index.Rmd','_posts/2015-07-30-r-index.md','_posts/2015-08-20-research-box-index.html','_posts/ggplot2','_posts/julia','_posts/matlab','_posts/matplotlib','_posts/nodejs','_posts/pandas','_posts/python','_posts/r','_posts/tutorials','_posts/user_guide_matlab','_posts/user_guide_python']
20+
exclude: ['*.Rmd','_posts/2015-09-09-matlab-reference.html','_posts/2015-09-06-r-reference.html','_posts/2015-09-06-python-reference.html','_posts/2015-08-19-plotly_js-reference.html','_posts/2015-04-05-ggplot2-index.html','_posts/2015-04-05-julia-index.html','_posts/2015-04-05-matplotlib-index.html','_posts/2015-04-05-node_js-index.html','_posts/2015-04-05-plotly_js-index.html','_posts/2015-04-05-plotlyjs-function-reference.md','_posts/2015-04-05-python-index.html','_posts/2015-05-25-ipython-notebooks_gallery.html','_posts/2015-05-25-ipython-notebooks_index.html','_posts/2015-07-13-eula_index.html','_posts/2015-07-19-pandas.html','_posts/2015-07-26-index.html','_posts/2015-07-30-r-index.Rmd','_posts/2015-07-30-r-index.md','_posts/2015-08-20-research-box-index.html','_posts/ggplot2','_posts/julia','_posts/matplotlib','_posts/nodejs','_posts/pandas','_posts/plotly_js','_posts/python','_posts/r','_posts/tutorials','_posts/user_guide_matlab','_posts/user_guide_python']
2121
#exclude: [_posts/temp, '*.Rmd']
2222

2323
# ---
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
---
2+
name: Ternary Contour Plot with <pre><code>TernPlot</code></pre>
3+
plot_url: https://plot.ly/~chelsea_lyn/1054
4+
arrangement: horizontal
5+
language: matlab
6+
suite: ternary-plots
7+
order: 1
8+
sitemap: false
9+
---
10+
To make this plot, you'll need the the Ternplot package<br>
11+
from the MATLAB <a href="http://www.mathworks.com/matlabcentral/fileexchange/2299-alchemyst-ternplot">File exchange</a>
12+
13+
% add data
14+
% An + Bn + Cn = 1
15+
% Z controls contour
16+
A = [0 .2 .2 .2 0 .6 .75 .9 0 1 .8 .3];
17+
B = [1 .2 .4 .1 0 .4 .05 0 .8 0 .05 .3];
18+
C = [0 .6 .4 .7 1 0 .2 .1 .2 0 .15 .4];
19+
Z = [.1 .5 .1 .2 1 .8 .4 0 .1 .6 1 .7];
20+
21+
% create figure
22+
fig = figure;
23+
terncontour(A, B, C, Z)
24+
ternlabel('A', 'B', 'C')
25+
26+
% Plotly
27+
pf = fig2plotly(fig, 'strip', false, 'filename', 'YOUR_FILENAME');
28+
% Edit the contour fill and color in Plotly's online editor

_posts/matlab/ternary-plots/2015-07-20-ternary-scatter.html

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,42 +4,42 @@
44
arrangement: horizontal
55
language: matlab
66
suite: ternary-plots
7-
order: 1
7+
order: 2
88
sitemap: false
99
---
1010
To make this plot, you'll need the the Ternplot package<br>
1111
from the MATLAB <a href="http://www.mathworks.com/matlabcentral/fileexchange/2299-alchemyst-ternplot">File exchange</a>
1212

1313
%%% Add Data
1414
% Alkalai Or
15-
OrA = [79.30 54.10 68.64 87.70 80.36 72.98 75.70 78.06 ...
15+
OrA = [79.30 54.10 68.64 87.70 80.36 72.98 75.70 78.06 ...
1616
71.88 66.01 60.82 75.47 66.27 66.72 76.57 76.31];
1717
% Alkalai An
1818
AnA = [2.53 3.64 2.96 1.94 3.45 1.75 1.74 1.43 0.85 0.88 ...
1919
0.88 0.86 1.02 1.24 0.71 0.50];
2020
% Alkalai Ab
2121
AbA = [18.17 42.26 28.40 10.36 16.19 25.27 22.56 20.51 ...
2222
27.27 33.11 38.30 23.67 32.71 32.04 22.72 23.19];
23-
23+
2424
% Plagioclase Or
25-
OrP = [4.16 8.07 6.60 1.79 4.60 8.81 6.55 6.08 5.77 ...
25+
OrP = [4.16 8.07 6.60 1.79 4.60 8.81 6.55 6.08 5.77 ...
2626
6.45 21.69 7.78 6.75 6.85 6.34 6.02];
2727
% Plagioclase An
2828
AnP = [71.81 28.29 39.49 87.15 70.96 26.72 33.76 35.96 ...
2929
21.00 15.31 4.68 20.04 13.24 15.12 20.66 16.75];
3030
% Plagioclase Ab
31-
AbP = [24.03 63.64 53.91 11.06 24.44 64.47 59.69 57.96 ...
31+
AbP = [24.03 63.64 53.91 11.06 24.44 64.47 59.69 57.96 ...
3232
73.23 78.24 73.63 72.18 80.01 78.03 73.00 77.23];
33-
33+
3434
% Barium Or
3535
OrB = [29.03 68.60 70.91 11.00 34.00 44.47];
3636
% Barium An
3737
AnB = [31.80 10.29 19.49 17.15 10.96 26.72];
3838
% Barium Ab
3939
AbB = [29.03 60.60 50.91 11.00 24.00 44.47];
40-
40+
4141
% Create figure with ternplot(a,b,c,'marker_specifications')
42-
% To plot multiple groups, turn hold on and repeat ternplot()
42+
% To plot multiple groups, turn hold on and repeat ternplot()
4343
fig = figure;
4444
ternplot(OrA, AnA, AbA, 'x', 'markersize', 6)
4545
hold on
@@ -48,7 +48,7 @@
4848
ternlabel('Or','An','Ab')
4949
legend('Alkalai','Plagioclase','Barium')
5050
hold off
51-
51+
5252
% Plotly!
5353
pf = fig2plotly(fig, 'strip', false, 'filename', 'ADD_YOUR_FILENAME');
5454
pf.plotly;
Lines changed: 171 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,171 @@
1+
---
2+
name: Simple Ternary Contour Plot
3+
plot_url: https://plot.ly/~tarzzz/2234
4+
arrangement: horizontal
5+
language: matlab
6+
suite: ternary-plots
7+
order: 0
8+
sitemap: false
9+
---
10+
11+
trace1 = struct(...
12+
'a', [0, 15, 20, 20, 5, 5, 0], ...
13+
'b', [70, 85, 80, 53, 53, 45, 50], ...
14+
'c', [30, 0, 0, 32, 42, 50, 50], ...
15+
'fill', 'toself', ...
16+
'fillcolor', '#8dd3c7', ...
17+
'line', struct('color', '#444'), ...
18+
'mode', 'lines', ...
19+
'text', 'sandy loam', ...
20+
'type', 'scatterternary', ...
21+
'uid', 'a1a8b8');
22+
trace2 = struct(...
23+
'a', [20, 35, 35, 28, 20], ...
24+
'b', [80, 65, 45, 45, 53], ...
25+
'c', [0, 0, 20, 27, 32], ...
26+
'fill', 'toself', ...
27+
'fillcolor', '#ffffb3', ...
28+
'line', struct('color', '#444'), ...
29+
'mode', 'lines', ...
30+
'text', 'sandy clay loam', ...
31+
'type', 'scatterternary', ...
32+
'uid', 'c72344');
33+
trace3 = struct(...
34+
'a', [40, 40, 28, 28], ...
35+
'b', [45, 20, 20, 45], ...
36+
'c', [15, 40, 52, 27], ...
37+
'fill', 'toself', ...
38+
'fillcolor', '#bebada', ...
39+
'line', struct('color', '#444'), ...
40+
'mode', 'lines', ...
41+
'text', 'clay loam', ...
42+
'type', 'scatterternary', ...
43+
'uid', '3eab74');
44+
trace4 = struct(...
45+
'a', [0, 10, 15, 0], ...
46+
'b', [90, 90, 85, 70], ...
47+
'c', [10, 0, 0, 30], ...
48+
'fill', 'toself', ...
49+
'fillcolor', '#fb8072', ...
50+
'line', struct('color', '#444'), ...
51+
'mode', 'lines', ...
52+
'text', 'loamy sand', ...
53+
'type', 'scatterternary', ...
54+
'uid', 'b9dc9f');
55+
trace5 = struct(...
56+
'a', [35, 35, 55], ...
57+
'b', [65, 45, 45], ...
58+
'c', [0, 20, 0], ...
59+
'fill', 'toself', ...
60+
'fillcolor', '#80b1d3', ...
61+
'line', struct('color', '#444'), ...
62+
'mode', 'lines', ...
63+
'text', 'sandy clay', ...
64+
'type', 'scatterternary', ...
65+
'uid', '381ad2');
66+
trace6 = struct(...
67+
'a', [60, 40, 40], ...
68+
'b', [0, 0, 20], ...
69+
'c', [40, 60, 40], ...
70+
'fill', 'toself', ...
71+
'fillcolor', '#fdb462', ...
72+
'line', struct('color', '#444'), ...
73+
'mode', 'lines', ...
74+
'text', 'silty clay', ...
75+
'type', 'scatterternary', ...
76+
'uid', '8cc163');
77+
trace7 = struct(...
78+
'a', [0, 28, 28, 12, 12, 0], ...
79+
'b', [50, 22, 0, 0, 8, 20], ...
80+
'c', [50, 50, 72, 88, 80, 80], ...
81+
'fill', 'toself', ...
82+
'fillcolor', '#b3de69', ...
83+
'line', struct('color', '#444'), ...
84+
'mode', 'lines', ...
85+
'text', 'silty loam', ...
86+
'type', 'scatterternary', ...
87+
'uid', '6f33dc');
88+
trace8 = struct(...
89+
'a', [0, 10, 0], ...
90+
'b', [100, 90, 90], ...
91+
'c', [0, 0, 10], ...
92+
'fill', 'toself', ...
93+
'fillcolor', '#fccde5', ...
94+
'line', struct('color', '#444'), ...
95+
'mode', 'lines', ...
96+
'text', 'sand', ...
97+
'type', 'scatterternary', ...
98+
'uid', 'cf9e4b');
99+
trace9 = struct(...
100+
'a', [28, 28, 40, 40], ...
101+
'b', [0, 20, 20, 0], ...
102+
'c', [72, 52, 40, 60], ...
103+
'fill', 'toself', ...
104+
'fillcolor', '#d9d9d9', ...
105+
'line', struct('color', '#444'), ...
106+
'mode', 'lines', ...
107+
'text', 'silty clay loam', ...
108+
'type', 'scatterternary', ...
109+
'uid', 'cb4ee4');
110+
trace10 = struct(...
111+
'a', [55, 100, 60, 40, 40], ...
112+
'b', [45, 0, 0, 20, 45], ...
113+
'c', [0, 0, 40, 40, 15], ...
114+
'fill', 'toself', ...
115+
'fillcolor', '#bc80bd', ...
116+
'line', struct('color', '#444'), ...
117+
'mode', 'lines', ...
118+
'text', 'clay', ...
119+
'type', 'scatterternary', ...
120+
'uid', '05c24e');
121+
trace11 = struct(...
122+
'a', [0, 0, 12, 12], ...
123+
'b', [0, 20, 8, 0], ...
124+
'c', [100, 80, 80, 88], ...
125+
'fill', 'toself', ...
126+
'fillcolor', '#ccebc5', ...
127+
'line', struct('color', '#444'), ...
128+
'mode', 'lines', ...
129+
'text', 'silt', ...
130+
'type', 'scatterternary', ...
131+
'uid', 'bdc504');
132+
trace12 = struct(...
133+
'a', [28, 28, 5, 5, 20], ...
134+
'b', [45, 22, 45, 53, 53], ...
135+
'c', [27, 50, 50, 42, 32], ...
136+
'fill', 'toself', ...
137+
'fillcolor', '#ffed6f', ...
138+
'line', struct('color', '#444'), ...
139+
'mode', 'lines', ...
140+
'text', 'loam', ...
141+
'type', 'scatterternary', ...
142+
'uid', 'ef23fc');
143+
data = {trace1, trace2, trace3, trace4, trace5, trace6, trace7, trace8, trace9, trace10, trace11, trace12};
144+
layout = struct(...
145+
'autosize', true, ...
146+
'height', 545, ...
147+
'showlegend', false, ...
148+
'ternary', struct(...
149+
'aaxis', struct(...
150+
'linewidth', 2, ...
151+
'min', 0.01, ...
152+
'ticks', 'outside', ...
153+
'ticksuffix', '%', ...
154+
'title', 'clay'), ...
155+
'baxis', struct(...
156+
'linewidth', 2, ...
157+
'min', 0.01, ...
158+
'ticks', 'outside', ...
159+
'ticksuffix', '%', ...
160+
'title', 'sand'), ...
161+
'caxis', struct(...
162+
'linewidth', 2, ...
163+
'min', 0.01, ...
164+
'ticks', 'outside', ...
165+
'ticksuffix', '%', ...
166+
'title', 'silt'), ...
167+
'sum', 100), ...
168+
'title', 'Simple Ternary Contour Plot with Python', ...
169+
'width', 1044);
170+
response = plotly(data, struct('layout', layout));
171+
plot_url = response.url

0 commit comments

Comments
 (0)