-
Notifications
You must be signed in to change notification settings - Fork 1
/
plot_field_results.m
47 lines (39 loc) · 1.5 KB
/
plot_field_results.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
load_field_data;
%% nmae
fh_mae = figure('Name', 'Mean NMAE', 'units', 'inch', ...
'position', [0, 0, 4.6, 3], 'color', 'w', 'DefaultAxesFontSize', 11);
colormap(cmap);
[~, idx] = sort(nmae(:,1), 1);
b = bar([results.grid_size], 100*nmae(idx,:)', 'grouped', 'EdgeColor','none');
% don't forget to also sort the colors so they match the other figure
for i=1:length(idx)
b(i).FaceColor = colors(model_names{idx(i)});
end
ax = fh_mae.CurrentAxes;
ax.YGrid = 'on';
ax.YMinorGrid = 'on';
xticks(ax, cell2mat(options.grid_sizes));
xlabel(ax, 'Grid Size $n_g$', 'Interpreter', 'latex');
ylabel(ax, 'N-MAE (\%)', 'Interpreter', 'latex');
legend(model_names(idx));
%set(fh_mae, 'PaperUnits', 'inches');
%set(fh_mae, 'PaperSize', [3.45/2, 2.1]);
export_fig(fh_mae, 'figures/interp_field_nmae.pdf');
%% r2
fh_r2 = figure('Name', 'Mean R2', 'units', 'inch', ...
'position', [0, 0, 4.6, 3], 'color', 'w', 'DefaultAxesFontSize', 8);
colormap(cmap);
% we sort the by the r2 in the lowest grid resolution
%[~, idx] = sort(r2(:,1), 1, 'descend');
b = bar([results.grid_size], r2(idx,:)', 'grouped', 'EdgeColor','none');
% don't forget to also sort the colors so they match the other figure
for i=1:length(idx)
b(i).FaceColor = colors(model_names{idx(i)});
end
ax = fh_r2.CurrentAxes;
xticks(ax, cell2mat(options.grid_sizes));
xlabel(ax, 'Grid Size $n_g$', 'Interpreter', 'latex');
ylabel(ax, '$R^2$ ', 'Interpreter', 'latex');
ylim(ax, [min(r2(:))-0.1, 1])
legend(model_names(idx));
export_fig(fh_r2, 'figures/interp_field_r2.pdf');