forked from plotly/plotly_matlab
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfig2plotly.m
More file actions
53 lines (33 loc) · 1.37 KB
/
fig2plotly.m
File metadata and controls
53 lines (33 loc) · 1.37 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
45
46
47
48
49
50
51
52
53
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