-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcreate_plots.m
74 lines (68 loc) · 1.79 KB
/
create_plots.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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
function [] = create_plots(data, predictionLocations, predictionMean, predictionVariance, verbose, displayPlots, savePlots, plotsFilePath)
%% CREATE_PLOTS creates the plots for the 'prediction' calculationType when plotting is true
%
% Input: data, predictionLocations, predictionMean, predictionVariance,
% verbose, displayPlots, savePlots, plotsFilePath
%
% Output: [] (empty vector)
%
if verbose
disp('Beginning plotting')
end
% get the size of the data array
[~, nCols] = size(data);
% values is stored in different column depending if linear trend removed
if nCols == 3
values = data(:,3);
elseif nCols == 4
values = data(:,4);
end
% Figure 1
figure
if ~displayPlots
set(gcf,'Visible', 'off');
end
scatter(data(:,1), data(:,2), 5, values,'square', 'filled');
colormap(parula)
colorbar
[cmin,cmax] = caxis;
caxis([cmin, cmax])
title('Observations')
xlabel('x coordinates')
ylabel('y coordinates')
if savePlots
saveas(gcf, fullfile(plotsFilePath, 'observations'), 'png');
end
% Figure 2
figure
if ~displayPlots
set(gcf,'Visible', 'off');
end
scatter(predictionLocations(:,1), predictionLocations(:,2), 5, predictionMean, 'square', 'filled');
colormap(parula)
colorbar
caxis([cmin, cmax])
title('Prediction mean')
xlabel('x coordinates')
ylabel('y coordinates')
if savePlots
saveas(gcf, fullfile(plotsFilePath, 'prediction_mean'), 'png');
end
% Figure 3
figure
if ~displayPlots
set(gcf,'Visible', 'off');
end
scatter(predictionLocations(:,1), predictionLocations(:,2), 5, predictionVariance, 'square', 'filled');
colormap(flip(autumn))
colorbar
title('Prediction variance')
xlabel('x coordinates')
ylabel('y coordinates')
if savePlots
saveas(gcf, fullfile(plotsFilePath, 'prediction_variance'), 'png');
end
if verbose % Display progress indicators
disp('Plotting completed')
end
end