Skip to content

Commit 534e557

Browse files
committed
updated fig2plotly()
1 parent 80167f2 commit 534e557

File tree

1 file changed

+28
-18
lines changed

1 file changed

+28
-18
lines changed

matlab/2021-08-04-2D-Histogram.md

Lines changed: 28 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -239,31 +239,41 @@ x = [x0; x1];
239239
y = [y0; y1];
240240
241241
trace1 = struct(...
242-
'x', x0, ...
243-
'y', y0, ...
244-
'mode', 'markers', ...
245-
'marker', struct(...
246-
'symbol', 'circle', ...
247-
'opacity', 0.7), ...
248-
'type', 'scatter');
242+
'x', x0, ...
243+
'y', y0, ...
244+
'mode', 'markers', ...
245+
'marker', struct(...
246+
'symbol', 'circle', ...
247+
'opacity', 0.7), ...
248+
'type', 'scatter');
249249
250250
trace2 = struct(...
251-
'x', x1, ...
252-
'y', y1, ...
253-
'mode', 'markers', ...
254-
'marker', struct(...
255-
'symbol', 'square', ...
256-
'opacity', 0.7), ...
257-
'type', 'scatter');
251+
'x', x1, ...
252+
'y', y1, ...
253+
'mode', 'markers', ...
254+
'marker', struct(...
255+
'symbol', 'square', ...
256+
'opacity', 0.7), ...
257+
'type', 'scatter');
258258
259259
trace3 = struct(...
260-
'x', x, ...
261-
'y', y, ...
262-
'type', 'histogram2d');
260+
'x', x, ...
261+
'y', y, ...
262+
'type', 'histogram2d');
263263
264264
data = {trace1, trace2, trace3};
265265
266-
plotly(data);
266+
layout = struct(...
267+
'legend', struct(...
268+
'y', 1.0, ...
269+
'yanchor', 'bottom', ...
270+
'x', 1.0, ...
271+
'xanchor', 'right'), ...
272+
'xaxis', struct('zeroline', false), ...
273+
'yaxis', struct('zeroline', false) ...
274+
);
275+
276+
plotly(data, struct('layout', layout));
267277
```
268278

269279
<!--------------------- EXAMPLE BREAK ------------------------->

0 commit comments

Comments
 (0)