|
1 | 1 | function p = fig2plotly(varargin) |
| 2 | + %----------------------------FIG2PLOTLY-------------------------------% |
2 | 3 |
|
3 | | -%------------------------------FIG2PLOTLY---------------------------------% |
| 4 | + % Convert a MATLAB figure to a Plotly Figure |
4 | 5 |
|
5 | | -% Convert a MATLAB figure to a Plotly Figure |
| 6 | + % [CALL]: |
6 | 7 |
|
7 | | -% [CALL]: |
| 8 | + % p = fig2plotly |
| 9 | + % p = fig2plotly(fig_han) |
| 10 | + % p = fig2plotly(fig_han, 'property', value, ...) |
8 | 11 |
|
9 | | -% p = fig2plotly |
10 | | -% p = fig2plotly(fig_han) |
11 | | -% p = fig2plotly(fig_han, 'property', value, ...) |
| 12 | + % [INPUTS]: [TYPE]{default} - description/'options' |
12 | 13 |
|
13 | | -% [INPUTS]: [TYPE]{default} - description/'options' |
| 14 | + % fig_han: [handle]{gcf} - figure handle |
| 15 | + % fig_struct: [structure array]{get(gcf)} - figure handle structure |
| 16 | + % array |
14 | 17 |
|
15 | | -% fig_han: [handle]{gcf} - figure handle |
16 | | -% fig_struct: [structure array]{get(gcf)} - figure handle structure array |
| 18 | + % [VALID PROPERTIES / VALUES]: |
17 | 19 |
|
18 | | -% [VALID PROPERTIES / VALUES]: |
| 20 | + % filename: [string]{'untitled'} - filename as appears on Plotly |
| 21 | + % fileopt: [string]{'new'} - 'new, overwrite, extend, append' |
| 22 | + % world_readable: [boolean]{true} - public(true) / private(false) |
| 23 | + % link: [boolean]{true} - show hyperlink (true) / no hyperlink (false) |
| 24 | + % open: [boolean]{true} - open plot in browser (true) |
19 | 25 |
|
20 | | -% filename: [string]{'untitled'} - filename as appears on Plotly |
21 | | -% fileopt: [string]{'new'} - 'new, overwrite, extend, append' |
22 | | -% world_readable: [boolean]{true} - public(true) / private(false) |
23 | | -% link: [boolean]{true} - show hyperlink (true) / no hyperlink (false) |
24 | | -% open: [boolean]{true} - open plot in browser (true) |
| 26 | + % [OUTPUT]: |
25 | 27 |
|
26 | | -% [OUTPUT]: |
| 28 | + % p - plotlyfig object |
27 | 29 |
|
28 | | -% p - plotlyfig object |
| 30 | + % [ADDITIONAL RESOURCES]: |
29 | 31 |
|
30 | | -% [ADDITIONAL RESOURCES]: |
| 32 | + % For full documentation and examples, see https://plot.ly/matlab |
31 | 33 |
|
32 | | -% For full documentation and examples, see https://plot.ly/matlab |
| 34 | + %---------------------------------------------------------------------% |
33 | 35 |
|
34 | | -%-------------------------------------------------------------------------% |
| 36 | + %--FIGURE INITIALIZATION--% |
| 37 | + if nargin == 0 |
| 38 | + varargin{1} = gcf; |
| 39 | + end |
35 | 40 |
|
36 | | -%--FIGURE INITIALIZATION--% |
37 | | -if nargin == 0 |
38 | | - varargin{1} = gcf; |
39 | | -end |
40 | | - |
41 | | -%-------------------------------------------------------------------------% |
42 | | - |
43 | | -%--CONSTRUCT PLOTLY FIGURE OBJECT--% |
44 | | -p = plotlyfig(varargin{:}); |
45 | | - |
46 | | -%-------------------------------------------------------------------------% |
47 | | - |
48 | | -%--MAKE CALL TO PLOTLY--% |
49 | | -p.plotly; |
50 | | - |
51 | | -%-------------------------------------------------------------------------% |
| 41 | + %--CONSTRUCT PLOTLY FIGURE OBJECT--% |
| 42 | + p = plotlyfig(varargin{:}); |
52 | 43 |
|
| 44 | + %--MAKE CALL TO PLOTLY--% |
| 45 | + p.plotly; |
53 | 46 | end |
0 commit comments