forked from plotly/plotly_matlab
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplotlylayout.m
More file actions
37 lines (35 loc) · 1.07 KB
/
plotlylayout.m
File metadata and controls
37 lines (35 loc) · 1.07 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
function [response] = plotlylayout(varargin)
% plotlylayout- apply layout to a plotly plot
% [response] = plotlylayout(layout, kwargs)
% layout - struct specifying the layout
% kwargs - an optional argument struct
%
% See also plotly, plotlystyle, signin, signup
%
% For full documentation and examples, see https://plot.ly/api
% check if signed in
[un, key] = signin;
if isempty(un) || isempty(key)
error('Not signed in.')
end
%%%%%%%%%%%%%%%
% call plotly %
%%%%%%%%%%%%%%%
origin = 'layout';
args = varargin(1);
if nargin==2
if isstruct(varargin{end})
structargs = varargin{end};
f = lower(fieldnames(structargs));
if ~any(strcmp('filename',f))
structargs.filename = plotlysession;
end
if ~any(strcmp('fileopt',f))
structargs.fileopt = NaN;
end
end
else
structargs = struct('filename', plotlysession,'fileopt',NaN);
end
response = makecall(args, un, key, origin, structargs);
end