10
10
%
11
11
% For full documentation and examples, see https://plot.ly/api
12
12
origin = ' plot' ;
13
+ offline = true ;
14
+ struct_provided = false ;
15
+
13
16
if isstruct(varargin{end })
14
17
structargs = varargin{end };
15
18
f = lower(fieldnames(structargs ));
19
22
if ~any(strcmp(' fileopt' ,f ))
20
23
structargs.fileopt = NaN ;
21
24
end
25
+ if any(strcmp(' offline' , f ))
26
+ offline = getfield(structargs , ' offline' );
27
+ end
28
+
29
+ struct_provided = true ;
30
+
22
31
args = varargin(1 : (end - 1 ));
23
32
else
24
- structargs = struct(' filename' , NaN ,' fileopt' ,NaN );
33
+ if offline
34
+ structargs = struct(' filename' , ' untitled' , ' fileopt' , NaN );
35
+ else
36
+ structargs = struct(' filename' , NaN ,' fileopt' ,NaN );
37
+ end
25
38
args = varargin(1 : end );
39
+ struct_provided = false ;
40
+ end
41
+
42
+ if (offline )
43
+ if struct_provided
44
+ nofig_obj = plotlynofig(varargin{1 : end - 1 }, structargs );
45
+ else
46
+ nofig_obj = plotlynofig(varargin{1 : end }, structargs );
47
+ end
48
+ nofig_obj.layout.width = 840 ;
49
+ nofig_obj.layout.height = 630 ;
50
+ response = nofig_obj .plotly ;
51
+
52
+ else
53
+ response = makecall(args , origin , structargs );
26
54
end
27
55
28
- response = makecall(args , origin , structargs );
29
56
30
57
end
0 commit comments