1 function plot_svm(svm_file)
3 % plot_results(svm_file)
6 % Plots the results in the output file from Support Vector Machine
9 % svm_file matlab output file from Support Vector Machine
11 % Developed in Matlab 9.2.0.556344 (R2017a) on MACINTOSH.
12 % Angel Farguell (angel.farguell@gmail.com), 2019-03-21
13 %-------------------------------------------------------------------------
18 uu(uu==max(uu(:))) = nan;
20 ll(ll==min(ll(:))) = nan;
23 bb = [min(r.dxlon(~isnan(uu)))-dd, max(r.dxlon(~isnan(uu)))+dd, min(r.dxlat(~isnan(uu)))-dd, max(r.dxlat(~isnan(uu)))+dd];
25 S = repmat(5,sum(sum(~isnan(uu))),1);
26 C = repmat([1,0,0],sum(sum(~isnan(uu))),1);
27 h1 = scatter3(r.dxlon(~isnan(uu)), r.dxlat(~isnan(uu)), uu(~isnan(uu)), S, C, 'filled');
29 set(h1, 'MarkerEdgeAlpha', alpha, 'MarkerFaceAlpha', alpha)
31 ml = logical((r.dxlon >= bb(1)).*(r.dxlon <= bb(2)).*(r.dxlat >= bb(3)).*(r.dxlat <= bb(4)));
32 S = repmat(2,sum(sum(ml)),1);
33 C = repmat([0.2,0.7,0.2],sum(sum(ml)),1);
34 h2 = scatter3(r.dxlon(ml), r.dxlat(ml), ll(ml), S, C, 'filled');
36 set(h2, 'MarkerEdgeAlpha', alpha, 'MarkerFaceAlpha', alpha)
38 contour3(r.fxlon,r.fxlat,r.Z,100)
41 title('Support-vector machine: Satellite detections vs fire arrival time')
47 scatter3(r.dxlon(~isnan(uu)), r.dxlat(~isnan(uu)), uu(~isnan(uu)), 'r.')
49 contour3(r.fxlon,r.fxlat,r.Z,100)
50 title('Support-vector machine: Fire detections vs fire arrival time')
66 S = repmat(10,sum(fire),1);
67 C = repmat([1,0,0],sum(fire),1);
68 h1 = scatter3(r.X(fire,1),r.X(fire,2),r.X(fire,3),S,C,'filled');
70 set(h1, 'MarkerEdgeAlpha', alpha, 'MarkerFaceAlpha', alpha)
72 S = repmat(10,sum(ground),1);
73 C = repmat([0.2,0.7,0.2],sum(ground),1);
74 h2 = scatter3(r.X(ground,1),r.X(ground,2),r.X(ground,3),S,C,'filled');
76 set(h2, 'MarkerEdgeAlpha', alpha, 'MarkerFaceAlpha', alpha)
78 contour3(r.fxlon,r.fxlat,r.Z,100)
79 xlim([xmin,xmax]), ylim([ymin,ymax]), zlim([zmin,zmax]);
80 title('Support-vector machine: Satellite detections vs fire arrival time')
86 scatter3(r.X(fire,1), r.X(fire,2), r.X(fire,3), 'r.')
88 contour3(r.fxlon,r.fxlat,r.Z,100)
89 xlim([xmin,xmax]), ylim([ymin,ymax]), zlim([zmin,zmax]);
90 title('Support-vector machine: Fire detections vs fire arrival time')