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 ));
1922 if ~any(strcmp(' fileopt' ,f ))
2023 structargs.fileopt = NaN ;
2124 end
25+ if any(strcmp(' offline' , f ))
26+ offline = getfield(structargs , ' offline' );
27+ end
28+
29+ struct_provided = true ;
30+
2231 args = varargin(1 : (end - 1 ));
2332else
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
2538 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 );
2654end
2755
28- response = makecall(args , origin , structargs );
2956
3057end
0 commit comments