forked from plotly/plotly_matlab
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplotlygetfile.m
More file actions
29 lines (25 loc) · 1011 Bytes
/
plotlygetfile.m
File metadata and controls
29 lines (25 loc) · 1011 Bytes
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
function figure = plotlygetfile(file_owner, file_id)
[un, key, domain] = signin;
headers = struct(...
'name',...
{...
'plotly-username',...
'plotly-apikey',...
'plotly-version',...
'plotly-platform',...
'user-agent'
},...
'value',...
{...
un,...
key,...
plotly_version,...
'MATLAB',...
'MATLAB'
});
url = [domain, '/apigetfile/', file_owner, '/', num2str(file_id)];
[response_string, extras] = urlread2(url, 'Post', '', headers);
response_handler(response_string, extras);
response_object = loadjson(response_string);
figure = response_object.payload.figure;
end