From 53a0918e7a1ecefccb6d09192ea04dd65f08a383 Mon Sep 17 00:00:00 2001 From: Philipp Kainz Date: Sat, 27 Feb 2016 12:13:24 +0100 Subject: [PATCH 1/5] savefig shadowing: function call rename --- detector/acfSweeps.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/detector/acfSweeps.m b/detector/acfSweeps.m index 5c2edfa9..991182f4 100755 --- a/detector/acfSweeps.m +++ b/detector/acfSweeps.m @@ -60,7 +60,7 @@ function plotExps( rtDir, expNm, opts, lgd, lbl, T ) xlabel(lbl); set(gca,'XTick',1:N,'XTickLabel',lgd); % save plot fFig=[plDir expNm]; diary('off'); -for t=1:25, try savefig(fFig,1,'png'); break; catch, pause(1), end; end +for t=1:25, try save_fig(fFig,1,'png'); break; catch, pause(1), end; end end function [jobsTrn,jobsTst] = createJobs( rtDir, opts, T ) From 4f0dfa020aebffd87e01eaaba097272c17028b60 Mon Sep 17 00:00:00 2001 From: Philipp Kainz Date: Sat, 27 Feb 2016 12:13:48 +0100 Subject: [PATCH 2/5] savefig shadowing: function call rename --- detector/acfTest.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/detector/acfTest.m b/detector/acfTest.m index 977a5dbe..8953eacb 100644 --- a/detector/acfTest.m +++ b/detector/acfTest.m @@ -61,6 +61,6 @@ figure(show); plotRoc([fp tp],'logx',1,'logy',1,'xLbl','fppi',... 'lims',lims,'color','g','smooth',1,'fpTarget',ref); title(sprintf('log-average miss rate = %.2f%%',miss*100)); -savefig([name 'Roc'],show,'png'); +save_fig([name 'Roc'],show,'png'); end From d734cb97cc955b638ff2f4e7eea57f45e858ab36 Mon Sep 17 00:00:00 2001 From: Philipp Kainz Date: Sat, 27 Feb 2016 12:14:41 +0100 Subject: [PATCH 3/5] Rename savefig.m to save_fig.m --- external/other/{savefig.m => save_fig.m} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename external/other/{savefig.m => save_fig.m} (100%) diff --git a/external/other/savefig.m b/external/other/save_fig.m similarity index 100% rename from external/other/savefig.m rename to external/other/save_fig.m From e2b681b610efe34c63918c19ed4b625fdeb04812 Mon Sep 17 00:00:00 2001 From: Philipp Kainz Date: Sat, 27 Feb 2016 12:15:49 +0100 Subject: [PATCH 4/5] Update save_fig.m --- external/other/save_fig.m | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/external/other/save_fig.m b/external/other/save_fig.m index d559f67b..ea2af752 100644 --- a/external/other/save_fig.m +++ b/external/other/save_fig.m @@ -1,13 +1,13 @@ -function savefig(fname, varargin) +function save_fig(fname, varargin) -% Usage: savefig(filename, fighdl, options) +% Usage: save_fig(filename, fighdl, options) % % Saves a pdf, eps, png, jpeg, and/or tiff of the contents of the fighandle's (or current) figure. % It saves an eps of the figure and the uses Ghostscript to convert to the other formats. % The result is a cropped, clean picture. There are options for using rgb or cmyk colours, % or grayscale. You can also choose the resolution. % -% The advantage of savefig is that there is very little empty space around the figure in the +% The advantage of save_fig is that there is very little empty space around the figure in the % resulting files, you can export to more than one format at once, and Ghostscript generates % trouble-free files. % @@ -18,8 +18,8 @@ function savefig(fname, varargin) % fighdl: (default: gcf) Integer handle to figure. % % options: (default: '-r300', '-lossless', '-rgb') You can define your own -% defaults in a global variable savefig_defaults, if you want to, i.e. -% savefig_defaults= {'-r200','-gray'};. +% defaults in a global variable save_fig_defaults, if you want to, i.e. +% save_fig_defaults= {'-r200','-gray'};. % 'eps': Output in Encapsulated Post Script (no preview yet). % 'pdf': Output in (Adobe) Portable Document Format. % 'png': Output in Portable Network Graphics. @@ -40,7 +40,7 @@ function savefig(fname, varargin) % '-dbg': Displays gs command line(s). % % EXAMPLE: -% savefig('nicefig', 'pdf', 'jpeg', '-cmyk', '-c0.1', '-r250'); +% save_fig('nicefig', 'pdf', 'jpeg', '-cmyk', '-c0.1', '-r250'); % Saves the current figure to nicefig.pdf and nicefig.png, both in cmyk and at 250 dpi, % with high quality lossy compression. % @@ -53,7 +53,7 @@ function savefig(fname, varargin) % - No 'epstopdf' stuff anymore! Using '-dEPSCrop' option in gs instead! % Version 1.2, 2006-05-02: % - Added a '-dbg' option (see options, above). -% - Now looks for a global variable 'savefig_defaults' (see options, above). +% - Now looks for a global variable 'save_fig_defaults' (see options, above). % - More detailed Ghostscript options (user will not really notice). % - Warns when there is no device for a file-type/color-model combination. % Version 1.3, 2006-06-06: @@ -82,7 +82,7 @@ function savefig(fname, varargin) % - Added lossless compression, see option '-lossless', above. Works on most formats. % - Added lossy compression, see options '-c...', above. Works on 'pdf'. % Thanks to Olly Woodford for idea and implementation! -% - Removed option '-nointerpolate' -- now savefig never interpolates. +% - Removed option '-nointerpolate' -- now save_fig never interpolates. % - Fixed a few small bugs and removed some mlint comments. % Version 2.0, 2008-11-07: % - Added the possibility to include fonts into eps or pdf. @@ -143,7 +143,7 @@ function savefig(fname, varargin) set(fighdl, 'PaperUnits', 'centimeters', 'PaperSize', sz(3:4), 'PaperPosition', sz); % Set up the various devices. - % Those commented out are not yet supported by gs (nor by savefig). + % Those commented out are not yet supported by gs (nor by save_fig). % pdf-cmyk works due to the Matlab '-cmyk' export being carried over from eps to pdf. device.eps.rgb= sprintf(epsCmd, 'DeviceRGB', 'epswrite', [fname '.eps']); device.jpeg.rgb= sprintf(cmdEnd, 'jpeg', [fname '.jpeg']); @@ -160,9 +160,9 @@ function savefig(fname, varargin) device.tiff.gray= sprintf(cmdEnd, 'tiffgray', [fname '.tiff']); % Get options. - global savefig_defaults; % Add global defaults. - if( iscellstr(savefig_defaults)), varargin= {savefig_defaults{:}, varargin{:}}; - elseif(ischar(savefig_defaults)), varargin= {savefig_defaults, varargin{:}}; + global save_fig_defaults; % Add global defaults. + if( iscellstr(save_fig_defaults)), varargin= {save_fig_defaults{:}, varargin{:}}; + elseif(ischar(save_fig_defaults)), varargin= {save_fig_defaults, varargin{:}}; end varargin= {'-r300', '-lossless', '-rgb', varargin{:}}; % Add defaults. res= ''; @@ -183,11 +183,11 @@ function savefig(fname, varargin) otherwise if(regexp(varargin{n}, '^\-r[0-9]+$')), res= varargin{n}; elseif(regexp(varargin{n}, '^\-c[0-9.]+$')), comp= str2double(varargin{n}(3:end)); - else warning('pax:savefig:inputError', 'Unknown option in argument: ''%s''.', varargin{n}); + else warning('pax:save_fig:inputError', 'Unknown option in argument: ''%s''.', varargin{n}); end end else - warning('pax:savefig:inputError', 'Wrong type of argument: ''%s''.', class(varargin{n})); + warning('pax:save_fig:inputError', 'Wrong type of argument: ''%s''.', class(varargin{n})); end end types= unique(types); @@ -232,7 +232,7 @@ function savefig(fname, varargin) else cmd= device.(types{n}).rgb; % Use alternative. if(~strcmp(types{n}, 'eps')) % It works anyways for eps (VERY SHAKY!). - warning('pax:savefig:deviceError', ... + warning('pax:save_fig:deviceError', ... 'No device for %s using %s. Using rgb instead.', types{n}, color); end end From e73517a7fa280b58950c4ddde5c3be8be0773d9d Mon Sep 17 00:00:00 2001 From: Philipp Kainz Date: Sat, 27 Feb 2016 12:18:04 +0100 Subject: [PATCH 5/5] Update history.txt --- external/history.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/external/history.txt b/external/history.txt index 879c7e86..e524b949 100644 --- a/external/history.txt +++ b/external/history.txt @@ -1,4 +1,5 @@ Version NEW + -renamed function savefig -> save_fig, updated function calls in acfSweeps.m, acfTest.m: see issue #14 -acfSweeps.m: Added ACF parameter sweep code to toolbox -minor: opticalFlow, acfTrain, binaryTreeTrain1 @@ -341,4 +342,4 @@ Version 1.02 (29-Nov-05) -minor changes? Version 1.00 (02-Oct-05) - -initial version \ No newline at end of file + -initial version