-
Notifications
You must be signed in to change notification settings - Fork 165
Expand file tree
/
Copy pathfig2plotly.m
More file actions
44 lines (30 loc) · 1.17 KB
/
fig2plotly.m
File metadata and controls
44 lines (30 loc) · 1.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
function p = fig2plotly(varargin)
%----------------------------FIG2PLOTLY-------------------------------%
% Convert a MATLAB figure to a Plotly Figure
% [CALL]:
% p = fig2plotly
% p = fig2plotly(fig_han)
% p = fig2plotly(fig_han, 'property', value, ...)
% [INPUTS]: [TYPE]{default} - description/'options'
% fig_han: [handle]{gcf} - figure handle
% fig_struct: [structure array]{get(gcf)} - figure handle structure
% array
% [VALID PROPERTIES / VALUES]:
% filename: [string]{'untitled'} - filename as appears on Plotly
% fileopt: [string]{'new'} - 'new, overwrite, extend, append'
% world_readable: [boolean]{true} - public(true) / private(false)
% link: [boolean]{true} - show hyperlink (true) / no hyperlink (false)
% open: [boolean]{true} - open plot in browser (true)
% [OUTPUT]:
% p - plotlyfig object
% [ADDITIONAL RESOURCES]:
% For full documentation and examples, see https://plot.ly/matlab
%--FIGURE INITIALIZATION--%
if nargin == 0
varargin{1} = gcf;
end
%--CONSTRUCT PLOTLY FIGURE OBJECT--%
p = plotlyfig(varargin{:});
%--MAKE CALL TO PLOTLY--%
p.plotly;
end