-
Notifications
You must be signed in to change notification settings - Fork 165
Expand file tree
/
Copy pathplotlyhelp.m
More file actions
31 lines (28 loc) · 1.14 KB
/
plotlyhelp.m
File metadata and controls
31 lines (28 loc) · 1.14 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
function plotlyref = plotlyhelp(varargin)
% [EX]: plotlyhelp('scatter','fill');
%converts graph_obj_meta.json to struct/cell array and outputs key
plotlyref = load('plotly_reference.mat');
pr = plotlyref.pr;
pr.online = 'Access the online docs!';
try
switch length(varargin)
case 0
plotlyref = pr;
case 1
if (strcmpi('online', varargin{1}));
web('http://plot.ly/matlab/','-browser')
else
plotlyref = pr.(lower(varargin{1}));
end
case 2
plotlyref = pr.(lower(varargin{1})).(lower(varargin{2}));
case 3
plotlyref = pr.(lower(varargin{1})).(lower(varargin{2})).(lower(varargin{3}));
case 4 %does the struct nesting ever go beyond 4?
plotlyref = pr.(lower(varargin{1})).(lower(varargin{2})).(lower(varargin{3})).(lower(varargin{4}));
end
catch exception
fprintf(['\n\nSorry! We could not find what you were looking ' ...
'for. Please specify a valid Plotly reference.\n\n']);
end
end