1010%
1111% For full documentation and examples, see https://plot.ly/api
1212origin = ' plot' ;
13+ offline = true ;
14+ struct_provided = false ;
15+
1316if isstruct(varargin{end })
1417 structargs = varargin{end };
1518 f = lower(fieldnames(structargs ));
1619 if ~any(strcmp(' filename' ,f ))
17- structargs.filename = NaN ;
20+ if offline
21+ structargs.filename = ' untitled' ;
22+ else
23+ structargs.filename = NaN ;
24+ end
1825 end
1926 if ~any(strcmp(' fileopt' ,f ))
2027 structargs.fileopt = NaN ;
2128 end
29+ if any(strcmp(' offline' , f ))
30+ offline = getfield(structargs , ' offline' );
31+ end
32+
33+ struct_provided = true ;
34+
2235 args = varargin(1 : (end - 1 ));
36+
2337else
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
2544 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 );
2660end
2761
28- response = makecall(args , origin , structargs );
2962
3063end
0 commit comments