1 function plot_svm(varargin)
3 % plot_results(svm_file)
4 % plot_results(svm_file,zoom)
5 % plot_results(svm_file,zoom,result_file)
8 % Plots the results in the output file from Support Vector Machine
11 % file matlab output file from Support Vector Machine
12 % zoom boolean if plot zoom or not (default false)
14 % Developed in Matlab 9.2.0.556344 (R2017a) on MACINTOSH.
15 % Angel Farguell (angel.farguell@gmail.com), 2019-03-21
16 %-------------------------------------------------------------------------
20 if nargin < 1 || nargin > 3
21 error('plot_svm(svm_file) or plot_svm(svm_file,zoom) or plot_svm(svm_file,zoom,result_file)');
23 svm_file = varargin{1};
26 uu(uu==max(uu(:))) = nan;
28 ll(ll==min(ll(:))) = nan;
35 result_file = varargin{3};
36 r2 = load(result_file);
37 tt = (r2.T==r2.time_scale_num(2)-r2.time_scale_num(1));
45 scatter3(r.dxlon(~isnan(uu)), r.dxlat(~isnan(uu)), uu(~isnan(uu)), 'r*')
47 scatter3(r.dxlon(~isnan(ll)), r.dxlat(~isnan(ll)), ll(~isnan(ll)), 'g*')
50 scatter3(r.dxlon(~isnan(uu)), r.dxlat(~isnan(uu)), uu(~isnan(uu)), 'r*')
53 scatter3(r.dxlon(~isnan(ll)), r.dxlat(~isnan(ll)), ll(~isnan(ll)), 'g*')
56 contour3(r.fxlon(1:kk:end,1:kk:end),r.fxlat(1:kk:end,1:kk:end),r.Z(1:kk:end,1:kk:end),100)
57 title('Support-vector machine: Fire detections vs fire arrival time')
63 zz = [min(r.Z(:))-.5 min(r.Z(:))+1.5];
65 scatter3(r.dxlon(~isnan(uu)), r.dxlat(~isnan(uu)), uu(~isnan(uu)), 'r*')
68 scatter3(r.dxlon(~isnan(ll)), r.dxlat(~isnan(ll)), ll(~isnan(ll)), 'g*')
71 contour3(r.fxlon(1:kk:end,1:kk:end),r.fxlat(1:kk:end,1:kk:end),r.Z(1:kk:end,1:kk:end),500)
74 title('2 days envolving the ignition time')