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 ));
16
19
if ~any(strcmp(' filename' ,f ))
17
- structargs.filename = NaN ;
20
+ if offline
21
+ structargs.filename = ' untitled' ;
22
+ else
23
+ structargs.filename = NaN ;
24
+ end
18
25
end
19
26
if ~any(strcmp(' fileopt' ,f ))
20
27
structargs.fileopt = NaN ;
21
28
end
29
+ if any(strcmp(' offline' , f ))
30
+ offline = getfield(structargs , ' offline' );
31
+ end
32
+
33
+ struct_provided = true ;
34
+
22
35
args = varargin(1 : (end - 1 ));
36
+
23
37
else
24
- structargs = struct(' filename' , NaN ,' fileopt' ,NaN );
38
+
39
+ if offline
40
+ structargs = struct(' filename' , ' untitled' , ' fileopt' , NaN );
41
+ else
42
+ structargs = struct(' filename' , NaN ,' fileopt' ,NaN );
43
+ end
25
44
args = varargin(1 : end );
45
+ struct_provided = false ;
46
+ end
47
+
48
+ if offline
49
+ if (struct_provided )
50
+ nofig_obj = plotlynofig(varargin{1 : end - 1 }, structargs );
51
+ else
52
+ nofig_obj = plotlynofig(varargin{1 : end }, structargs );
53
+ end
54
+ nofig_obj.layout.width = 840 ;
55
+ nofig_obj.layout.height = 630 ;
56
+ response = nofig_obj .plotly ;
57
+
58
+ else
59
+ response = makecall(args , origin , structargs );
26
60
end
27
61
28
- response = makecall(args , origin , structargs );
29
62
30
63
end
0 commit comments