-
Notifications
You must be signed in to change notification settings - Fork 0
/
plot_xepr.m
53 lines (42 loc) · 960 Bytes
/
plot_xepr.m
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
function phandle = plot_xepr(dset)
%PLOT_XEPR Plots Xepr data.
%
% In addition to PLOT2D, PLOT2D_XEPR will create axis labels and an
% appropriate legend automatically from pars.
%
% SYNTAX:
% PLOT_XEPR(dset)
% phandle = PLOT_XEPR(ax, ...)
%
% INPUT:
% dsets - Xepr data set
%
% OUTPUT:
% phandle - plot handle
%
import esr_analyses.*
import esr_analyses.utils.*
%% Input Analyses
x = dset{:,1};
pars = dset.Properties.UserData;
N = width(dset) - 1;
x_label = sprintf('%s [%s]', pars.XNAM, pars.XUNI);
y_label = sprintf('%s [%s]', pars.IRNAM{1}, pars.IRUNI{1});
for k=1:N
y = dset{:,k+1};
%% Plot
subplot(1,N,k)
plot(x, y);
xlabel(x_label, 'Interpreter', 'none');
ylabel(y_label, 'Interpreter', 'none');
title(dset.Properties.VariableNames{k+1})
axis square;
grid on;
end
set(gca, 'XLimSpec', 'Tight');
sgtitle(pars.TITL, 'Interpreter', 'none');
%% Argout
if nargout > 0
phandle = gca;
end
end