[Dart-dev] [10513] DART: Ensuring the X ticks are consistent across both X axes.

nancy at ucar.edu nancy at ucar.edu
Mon Jul 18 16:12:25 MDT 2016


Revision: 10513
Author:   thoar
Date:     2016-07-18 16:12:25 -0600 (Mon, 18 Jul 2016)
Log Message:
-----------
Ensuring the X ticks are consistent across both X axes.
Reordering the set FontSize to be after the plot() command - it was not
having the desired effect prior to this revision.

Fixed some warnings from m-lint for cleaner functions.

Modified Paths:
--------------
    DART/branches/rma_trunk/diagnostics/matlab/plot_evolution.m
    DART/branches/rma_trunk/diagnostics/matlab/plot_rmse_xxx_evolution.m
    DART/branches/rma_trunk/diagnostics/matlab/two_experiments_evolution.m
    DART/trunk/diagnostics/matlab/plot_evolution.m
    DART/trunk/diagnostics/matlab/plot_rmse_xxx_evolution.m
    DART/trunk/diagnostics/matlab/two_experiments_evolution.m

-------------- next part --------------
Modified: DART/branches/rma_trunk/diagnostics/matlab/plot_evolution.m
===================================================================
--- DART/branches/rma_trunk/diagnostics/matlab/plot_evolution.m	2016-07-18 21:27:25 UTC (rev 10512)
+++ DART/branches/rma_trunk/diagnostics/matlab/plot_evolution.m	2016-07-18 22:12:25 UTC (rev 10513)
@@ -40,7 +40,7 @@
 %         A postscript file containing a page for each level - each region.
 %         The other file is a simple text file containing summary information
 %         about how many observations were assimilated, how many were available, etc.
-%         Both of these filenames contain the observation type, 
+%         Both of these filenames contain the observation type,
 %         copy and region as part of the name.
 %
 % EXAMPLE 1 - plot the evolution of the bias for all observation types, all levels
@@ -51,7 +51,7 @@
 %
 %
 % EXAMPLE 2 - plot the evolution of the rmse for just the radiosonde temperature obs
-%             This requires that the 'RADIOSONDE_TEMPERATURE' is one of the known 
+%             This requires that the 'RADIOSONDE_TEMPERATURE' is one of the known
 %             observation types in the netCDF file.
 %
 % fname   = 'obs_diag_output.nc';
@@ -78,9 +78,15 @@
 
 addRequired(p,'fname', at ischar);
 addRequired(p,'copy', at ischar);
-addParamValue(p,'obsname',default_obsname, at ischar);
-addParamValue(p,'range',default_range, at isnumeric);
-addParamValue(p,'level',default_level, at isnumeric);
+if (exist('inputParser/addParameter','file') == 2)
+   addParameter(p,'obsname',default_obsname, at ischar);
+   addParameter(p,'range',default_range, at isnumeric);
+   addParameter(p,'level',default_level, at isnumeric);
+else
+   addParamValue(p,'obsname',default_obsname, at ischar);
+   addParamValue(p,'range',default_range, at isnumeric);
+   addParamValue(p,'level',default_level, at isnumeric);
+end
 parse(p, fname, copy, varargin{:});
 
 % if you want to echo the input
@@ -187,6 +193,7 @@
 %%---------------------------------------------------------------------
 % Loop around (time-copy-level-region) observation types
 %----------------------------------------------------------------------
+psfname = cell(plotdat.nvars);
 
 for ivar = 1:plotdat.nvars
 
@@ -270,7 +277,7 @@
    end
 
    if (p.Results.level < 0)
-      wantedlevels = [1:plotdat.nlevels];
+      wantedlevels = 1:plotdat.nlevels;
    else
       wantedlevels = p.Results.level;
    end
@@ -393,12 +400,11 @@
 % don't need to be set.
 
 ax1 = subplot('position',figdata.position);
+h1 = plot(tg,cg,'k+-',ta,ca,'ro-','LineWidth',figdata.linewidth);
 set(ax1,'YAxisLocation','left','FontSize',figdata.fontsize)
+h  = legend(h1,'forecast', 'analysis');
+set(h,'Interpreter','none','Box','off','FontSize',figdata.fontsize)
 
-h1 = plot(tg,cg,'k+-',ta,ca,'ro-','LineWidth',figdata.linewidth);
-h  = legend('forecast', 'analysis');
-set(h,'Interpreter','none','Box','off')
-
 % get the range of the existing axis and replace with
 % replace y axis values
 % reset the axes limits
@@ -407,7 +413,6 @@
 axlims = [axlims(1:2) plotdat.Yrange];
 axis(axlims)
 
-
 switch lower(plotdat.copystring)
    case 'bias'
       % plot a zero-bias line
@@ -422,31 +427,35 @@
 ttot = plotdat.bincenters(plotdat.Nbins) - plotdat.bincenters(1) + 1;
 
 if ((plotdat.bincenters(1) > 1000) && (ttot > 5))
-   datetick('x',6,'keeplimits','keepticks');
-   monstr = datestr(plotdat.bincenters(1),21);
-   xlabelstring = sprintf('month/day - %s start',monstr);
+    datetick('x',6,'keeplimits','keepticks');
+    monstr = datestr(plotdat.bincenters(1),21);
+    xlabelstring = sprintf('month/day - %s start',monstr);
 elseif (plotdat.bincenters(1) > 1000)
-   datetick('x',15,'keeplimits','keepticks')
-   monstr = datestr(plotdat.bincenters(1),21);
-   xlabelstring = sprintf('%s start',monstr);
+    datetick('x',15,'keeplimits','keepticks')
+    monstr = datestr(plotdat.bincenters(1),21);
+    xlabelstring = sprintf('%s start',monstr);
 else
-   xlabelstring = 'days';
+    xlabelstring = 'days';
 end
 set(get(ax1,'Xlabel'),'String',xlabelstring, ...
-   'Interpreter','none','FontSize',figdata.fontsize)
+    'Interpreter','none','FontSize',figdata.fontsize)
 
 title({plotdat.myregion, plotdat.title, plotdat.subtitle}, ...
       'Interpreter', 'none', 'Fontsize', figdata.fontsize, 'FontWeight', 'bold')
 BottomAnnotation(plotdat)
 
 % create a separate scale for the number of observations
-ax2 = axes('position',get(ax1,'Position'), ...
-   'XAxisLocation','top', ...
-   'YAxisLocation','right', ...
+ax2 = axes( ...
+   'Position',get(ax1,'Position'), ...
+   'FontSize',get(ax1,'FontSize'), ...
+   'XColor'  ,get(ax1,'Xcolor'), ...
+   'XLim'    ,get(ax1,'XLim'), ...
+   'XTick'   ,get(ax1,'XTick'), ...
+   'YDir'    ,get(ax1,'YDir'), ...
    'Color','none', ...
-   'XColor',get(ax1,'Xcolor'), ...
    'YColor','b', ...
-   'FontSize',get(ax1,'FontSize'));
+   'XAxisLocation','top', ...
+   'YAxisLocation','right');
 
 h2 = line(t,nobs_poss,'Color','b','Parent',ax2);
 h3 = line(t,nobs_used,'Color','b','Parent',ax2);
@@ -519,7 +528,7 @@
    end
 end
 
-[~,i,j] = unique(basenames);
+[~,i,~] = unique(basenames);
 y     = cell(length(i),1);
 ydims = cell(length(i),1);
 for k = 1:length(i)

Modified: DART/branches/rma_trunk/diagnostics/matlab/plot_rmse_xxx_evolution.m
===================================================================
--- DART/branches/rma_trunk/diagnostics/matlab/plot_rmse_xxx_evolution.m	2016-07-18 21:27:25 UTC (rev 10512)
+++ DART/branches/rma_trunk/diagnostics/matlab/plot_rmse_xxx_evolution.m	2016-07-18 22:12:25 UTC (rev 10513)
@@ -40,7 +40,7 @@
 %         A postscript file containing a page for each level - each region.
 %         The other file is a simple text file containing summary information
 %         about how many observations were assimilated, how many were available, etc.
-%         Both of these filenames contain the observation type, 
+%         Both of these filenames contain the observation type,
 %         copy and region as part of the name.
 %
 % EXAMPLE 1 - plot the RMSE and totalspread on the same axis.
@@ -78,9 +78,15 @@
 
 addRequired(p,'fname', at ischar);
 addRequired(p,'copy', at ischar);
-addParamValue(p,'obsname',default_obsname, at ischar);
-addParamValue(p,'range',default_range, at isnumeric);
-addParamValue(p,'level',default_level, at isnumeric);
+if (exist('inputParser/addParameter','file') == 2)
+   addParameter(p,'obsname',default_obsname, at ischar);
+   addParameter(p,'range',default_range, at isnumeric);
+   addParameter(p,'level',default_level, at isnumeric);
+else
+   addParamValue(p,'obsname',default_obsname, at ischar);
+   addParamValue(p,'range',default_range, at isnumeric);
+   addParamValue(p,'level',default_level, at isnumeric);
+end
 parse(p, fname, copy, varargin{:});
 
 % if you want to echo the input
@@ -188,6 +194,7 @@
 %%---------------------------------------------------------------------
 % Loop around (time-copy-level-region) observation types
 %----------------------------------------------------------------------
+psfname = cell(plotdat.nvars);
 
 for ivar = 1:plotdat.nvars
 
@@ -271,7 +278,7 @@
    end
 
    if (p.Results.level < 0)
-      wantedlevels = [1:plotdat.nlevels];
+      wantedlevels = 1:plotdat.nlevels;
    else
       wantedlevels = p.Results.level;
    end
@@ -406,9 +413,8 @@
 % don't need to be set.
 
 ax1 = subplot('position',figdata.position);
+h1 = plot(t,rmse,'k+-',t,other,'ro-','LineWidth',figdata.linewidth);
 set(ax1,'YAxisLocation','left','FontSize',figdata.fontsize)
-
-h1 = plot(t,rmse,'k+-',t,other,'ro-','LineWidth',figdata.linewidth);
 h  = legend(h1,'rmse', plotdat.copystring);
 set(h,'Interpreter','none','Box','off')
 
@@ -420,7 +426,6 @@
 axlims = [axlims(1:2) plotdat.Yrange];
 axis(axlims)
 
-
 switch lower(plotdat.copystring)
    case 'bias'
       % plot a zero-bias line
@@ -435,31 +440,35 @@
 ttot = plotdat.bincenters(plotdat.Nbins) - plotdat.bincenters(1) + 1;
 
 if ((plotdat.bincenters(1) > 1000) && (ttot > 5))
-   datetick('x',6,'keeplimits','keepticks');
-   monstr = datestr(plotdat.bincenters(1),21);
-   xlabelstring = sprintf('month/day - %s start',monstr);
+    datetick('x',6,'keeplimits','keepticks');
+    monstr = datestr(plotdat.bincenters(1),21);
+    xlabelstring = sprintf('month/day - %s start',monstr);
 elseif (plotdat.bincenters(1) > 1000)
-   datetick('x',15,'keeplimits','keepticks')
-   monstr = datestr(plotdat.bincenters(1),21);
-   xlabelstring = sprintf('%s start',monstr);
+    datetick('x',15,'keeplimits','keepticks')
+    monstr = datestr(plotdat.bincenters(1),21);
+    xlabelstring = sprintf('%s start',monstr);
 else
-   xlabelstring = 'days';
+    xlabelstring = 'days';
 end
 set(get(ax1,'Xlabel'),'String',xlabelstring, ...
-   'Interpreter','none','FontSize',figdata.fontsize)
+    'Interpreter','none','FontSize',figdata.fontsize)
 
 title({plotdat.myregion, plotdat.title, plotdat.subtitle}, ...
       'Interpreter', 'none', 'Fontsize', figdata.fontsize, 'FontWeight', 'bold')
 BottomAnnotation(plotdat)
 
 % create a separate scale for the number of observations
-ax2 = axes('position',get(ax1,'Position'), ...
-   'XAxisLocation','top', ...
-   'YAxisLocation','right', ...
+ax2 = axes( ...
+   'Position',get(ax1,'Position'), ...
+   'FontSize',get(ax1,'FontSize'), ...
+   'XColor'  ,get(ax1,'Xcolor'), ...
+   'XLim'    ,get(ax1,'XLim'), ...
+   'XTick'   ,get(ax1,'XTick'), ...
+   'YDir'    ,get(ax1,'YDir'), ...
    'Color','none', ...
-   'XColor',get(ax1,'Xcolor'), ...
    'YColor','b', ...
-   'FontSize',get(ax1,'FontSize'));
+   'XAxisLocation','top', ...
+   'YAxisLocation','right');
 
 h2 = line(t,nobs_poss,'Color','b','Parent',ax2);
 h3 = line(t,nobs_used,'Color','b','Parent',ax2);
@@ -532,7 +541,7 @@
    end
 end
 
-[~,i,j] = unique(basenames);
+[~,i,~] = unique(basenames);
 y     = cell(length(i),1);
 ydims = cell(length(i),1);
 for k = 1:length(i)

Modified: DART/branches/rma_trunk/diagnostics/matlab/two_experiments_evolution.m
===================================================================
--- DART/branches/rma_trunk/diagnostics/matlab/two_experiments_evolution.m	2016-07-18 21:27:25 UTC (rev 10512)
+++ DART/branches/rma_trunk/diagnostics/matlab/two_experiments_evolution.m	2016-07-18 22:12:25 UTC (rev 10513)
@@ -20,11 +20,11 @@
 %
 % USAGE: two_experiments_evolution(files, titles, obsnames, copy, prpo, 'level', 1)
 %
-% files    : Cell array containing the locations of the obs_diag_output.nc 
+% files    : Cell array containing the locations of the obs_diag_output.nc
 %            files to compare. Each file is presumed to be the results from
 %            a single experiment.
 %
-% titles   : Cell array containing the titles used to annotate each of the experiments. 
+% titles   : Cell array containing the titles used to annotate each of the experiments.
 %
 % obsnames : Cell array containing the strings of each observation type to plot.
 %            Each observation type will be plotted in a separate graphic.
@@ -40,7 +40,7 @@
 %
 % level    : The index of the level to plot. Defaults to level 1.
 %
-% OUTPUT: A .pdf of each graphic is created. Each .pdf has a name that 
+% OUTPUT: A .pdf of each graphic is created. Each .pdf has a name that
 %         reflects the variable, quantity, and region being plotted.
 %
 % EXAMPLE
@@ -74,7 +74,13 @@
 addRequired(p,'obsnames', at iscell);
 addRequired(p,'copy', at ischar);
 addRequired(p,'prpo', at ischar);
-addParamValue(p,'level',default_level, at isnumeric);
+
+if (exist('inputParser/addParameter','file') == 2)
+   addParameter(p,'level',default_level, at isnumeric);
+else
+   addParamValue(p,'level',default_level, at isnumeric);
+end
+
 parse(p, files, titles, obsnames, copy, prpo, varargin{:});
 
 % if you want to echo the input
@@ -476,15 +482,17 @@
 
 % Create another axes to use for plotting the observation counts
 
-ax2 = axes('position',get(ax1,'Position'), ...
-   'XAxisLocation','top', ...
-   'YAxisLocation','right', ...
+ax2 = axes( ...
+   'Position',get(ax1,'Position'), ...
+   'FontSize',get(ax1,'FontSize'), ...
+   'XColor'  ,get(ax1,'XColor'), ...
+   'XLim'    ,get(ax1,'XLim'), ...
+   'XTick'   ,get(ax1,'XTick'), ...
+   'YDir'    ,get(ax1,'YDir'), ...
    'Color','none', ...
-   'XColor',get(ax1,'XColor'), ...
    'YColor','b', ...
-   'XLim',get(ax1,'XLim'), ...
-   'YDir',get(ax1,'YDir'), ...
-   'FontSize',get(ax1,'FontSize'));
+   'XAxisLocation','top', ...
+   'YAxisLocation','right');
 
 % Plot the data, which sets the range of the axis
 for i = 1:Nexp
@@ -578,7 +586,7 @@
    set(h, 'Interpreter', 'none', ...
           'HorizontalAlignment','left', ...
           'FontSize', 8);
-      
+
    % If the observation is trusted for this experiment, annotate as such.
 
    switch lower(plotstruct{ifile}.trusted)

Modified: DART/trunk/diagnostics/matlab/plot_evolution.m
===================================================================
--- DART/trunk/diagnostics/matlab/plot_evolution.m	2016-07-18 21:27:25 UTC (rev 10512)
+++ DART/trunk/diagnostics/matlab/plot_evolution.m	2016-07-18 22:12:25 UTC (rev 10513)
@@ -40,7 +40,7 @@
 %         A postscript file containing a page for each level - each region.
 %         The other file is a simple text file containing summary information
 %         about how many observations were assimilated, how many were available, etc.
-%         Both of these filenames contain the observation type, 
+%         Both of these filenames contain the observation type,
 %         copy and region as part of the name.
 %
 % EXAMPLE 1 - plot the evolution of the bias for all observation types, all levels
@@ -51,7 +51,7 @@
 %
 %
 % EXAMPLE 2 - plot the evolution of the rmse for just the radiosonde temperature obs
-%             This requires that the 'RADIOSONDE_TEMPERATURE' is one of the known 
+%             This requires that the 'RADIOSONDE_TEMPERATURE' is one of the known
 %             observation types in the netCDF file.
 %
 % fname   = 'obs_diag_output.nc';
@@ -78,9 +78,15 @@
 
 addRequired(p,'fname', at ischar);
 addRequired(p,'copy', at ischar);
-addParamValue(p,'obsname',default_obsname, at ischar);
-addParamValue(p,'range',default_range, at isnumeric);
-addParamValue(p,'level',default_level, at isnumeric);
+if (exist('inputParser/addParameter','file') == 2)
+   addParameter(p,'obsname',default_obsname, at ischar);
+   addParameter(p,'range',default_range, at isnumeric);
+   addParameter(p,'level',default_level, at isnumeric);
+else
+   addParamValue(p,'obsname',default_obsname, at ischar);
+   addParamValue(p,'range',default_range, at isnumeric);
+   addParamValue(p,'level',default_level, at isnumeric);
+end
 parse(p, fname, copy, varargin{:});
 
 % if you want to echo the input
@@ -187,6 +193,7 @@
 %%---------------------------------------------------------------------
 % Loop around (time-copy-level-region) observation types
 %----------------------------------------------------------------------
+psfname = cell(plotdat.nvars);
 
 for ivar = 1:plotdat.nvars
 
@@ -270,7 +277,7 @@
    end
 
    if (p.Results.level < 0)
-      wantedlevels = [1:plotdat.nlevels];
+      wantedlevels = 1:plotdat.nlevels;
    else
       wantedlevels = p.Results.level;
    end
@@ -393,12 +400,11 @@
 % don't need to be set.
 
 ax1 = subplot('position',figdata.position);
+h1 = plot(tg,cg,'k+-',ta,ca,'ro-','LineWidth',figdata.linewidth);
 set(ax1,'YAxisLocation','left','FontSize',figdata.fontsize)
+h  = legend(h1,'forecast', 'analysis');
+set(h,'Interpreter','none','Box','off','FontSize',figdata.fontsize)
 
-h1 = plot(tg,cg,'k+-',ta,ca,'ro-','LineWidth',figdata.linewidth);
-h  = legend('forecast', 'analysis');
-set(h,'Interpreter','none','Box','off')
-
 % get the range of the existing axis and replace with
 % replace y axis values
 % reset the axes limits
@@ -407,7 +413,6 @@
 axlims = [axlims(1:2) plotdat.Yrange];
 axis(axlims)
 
-
 switch lower(plotdat.copystring)
    case 'bias'
       % plot a zero-bias line
@@ -422,31 +427,35 @@
 ttot = plotdat.bincenters(plotdat.Nbins) - plotdat.bincenters(1) + 1;
 
 if ((plotdat.bincenters(1) > 1000) && (ttot > 5))
-   datetick('x',6,'keeplimits','keepticks');
-   monstr = datestr(plotdat.bincenters(1),21);
-   xlabelstring = sprintf('month/day - %s start',monstr);
+    datetick('x',6,'keeplimits','keepticks');
+    monstr = datestr(plotdat.bincenters(1),21);
+    xlabelstring = sprintf('month/day - %s start',monstr);
 elseif (plotdat.bincenters(1) > 1000)
-   datetick('x',15,'keeplimits','keepticks')
-   monstr = datestr(plotdat.bincenters(1),21);
-   xlabelstring = sprintf('%s start',monstr);
+    datetick('x',15,'keeplimits','keepticks')
+    monstr = datestr(plotdat.bincenters(1),21);
+    xlabelstring = sprintf('%s start',monstr);
 else
-   xlabelstring = 'days';
+    xlabelstring = 'days';
 end
 set(get(ax1,'Xlabel'),'String',xlabelstring, ...
-   'Interpreter','none','FontSize',figdata.fontsize)
+    'Interpreter','none','FontSize',figdata.fontsize)
 
 title({plotdat.myregion, plotdat.title, plotdat.subtitle}, ...
       'Interpreter', 'none', 'Fontsize', figdata.fontsize, 'FontWeight', 'bold')
 BottomAnnotation(plotdat)
 
 % create a separate scale for the number of observations
-ax2 = axes('position',get(ax1,'Position'), ...
-   'XAxisLocation','top', ...
-   'YAxisLocation','right', ...
+ax2 = axes( ...
+   'Position',get(ax1,'Position'), ...
+   'FontSize',get(ax1,'FontSize'), ...
+   'XColor'  ,get(ax1,'Xcolor'), ...
+   'XLim'    ,get(ax1,'XLim'), ...
+   'XTick'   ,get(ax1,'XTick'), ...
+   'YDir'    ,get(ax1,'YDir'), ...
    'Color','none', ...
-   'XColor',get(ax1,'Xcolor'), ...
    'YColor','b', ...
-   'FontSize',get(ax1,'FontSize'));
+   'XAxisLocation','top', ...
+   'YAxisLocation','right');
 
 h2 = line(t,nobs_poss,'Color','b','Parent',ax2);
 h3 = line(t,nobs_used,'Color','b','Parent',ax2);
@@ -519,7 +528,7 @@
    end
 end
 
-[~,i,j] = unique(basenames);
+[~,i,~] = unique(basenames);
 y     = cell(length(i),1);
 ydims = cell(length(i),1);
 for k = 1:length(i)

Modified: DART/trunk/diagnostics/matlab/plot_rmse_xxx_evolution.m
===================================================================
--- DART/trunk/diagnostics/matlab/plot_rmse_xxx_evolution.m	2016-07-18 21:27:25 UTC (rev 10512)
+++ DART/trunk/diagnostics/matlab/plot_rmse_xxx_evolution.m	2016-07-18 22:12:25 UTC (rev 10513)
@@ -40,7 +40,7 @@
 %         A postscript file containing a page for each level - each region.
 %         The other file is a simple text file containing summary information
 %         about how many observations were assimilated, how many were available, etc.
-%         Both of these filenames contain the observation type, 
+%         Both of these filenames contain the observation type,
 %         copy and region as part of the name.
 %
 % EXAMPLE 1 - plot the RMSE and totalspread on the same axis.
@@ -78,9 +78,15 @@
 
 addRequired(p,'fname', at ischar);
 addRequired(p,'copy', at ischar);
-addParamValue(p,'obsname',default_obsname, at ischar);
-addParamValue(p,'range',default_range, at isnumeric);
-addParamValue(p,'level',default_level, at isnumeric);
+if (exist('inputParser/addParameter','file') == 2)
+   addParameter(p,'obsname',default_obsname, at ischar);
+   addParameter(p,'range',default_range, at isnumeric);
+   addParameter(p,'level',default_level, at isnumeric);
+else
+   addParamValue(p,'obsname',default_obsname, at ischar);
+   addParamValue(p,'range',default_range, at isnumeric);
+   addParamValue(p,'level',default_level, at isnumeric);
+end
 parse(p, fname, copy, varargin{:});
 
 % if you want to echo the input
@@ -188,6 +194,7 @@
 %%---------------------------------------------------------------------
 % Loop around (time-copy-level-region) observation types
 %----------------------------------------------------------------------
+psfname = cell(plotdat.nvars);
 
 for ivar = 1:plotdat.nvars
 
@@ -271,7 +278,7 @@
    end
 
    if (p.Results.level < 0)
-      wantedlevels = [1:plotdat.nlevels];
+      wantedlevels = 1:plotdat.nlevels;
    else
       wantedlevels = p.Results.level;
    end
@@ -406,9 +413,8 @@
 % don't need to be set.
 
 ax1 = subplot('position',figdata.position);
+h1 = plot(t,rmse,'k+-',t,other,'ro-','LineWidth',figdata.linewidth);
 set(ax1,'YAxisLocation','left','FontSize',figdata.fontsize)
-
-h1 = plot(t,rmse,'k+-',t,other,'ro-','LineWidth',figdata.linewidth);
 h  = legend(h1,'rmse', plotdat.copystring);
 set(h,'Interpreter','none','Box','off')
 
@@ -420,7 +426,6 @@
 axlims = [axlims(1:2) plotdat.Yrange];
 axis(axlims)
 
-
 switch lower(plotdat.copystring)
    case 'bias'
       % plot a zero-bias line
@@ -435,31 +440,35 @@
 ttot = plotdat.bincenters(plotdat.Nbins) - plotdat.bincenters(1) + 1;
 
 if ((plotdat.bincenters(1) > 1000) && (ttot > 5))
-   datetick('x',6,'keeplimits','keepticks');
-   monstr = datestr(plotdat.bincenters(1),21);
-   xlabelstring = sprintf('month/day - %s start',monstr);
+    datetick('x',6,'keeplimits','keepticks');
+    monstr = datestr(plotdat.bincenters(1),21);
+    xlabelstring = sprintf('month/day - %s start',monstr);
 elseif (plotdat.bincenters(1) > 1000)
-   datetick('x',15,'keeplimits','keepticks')
-   monstr = datestr(plotdat.bincenters(1),21);
-   xlabelstring = sprintf('%s start',monstr);
+    datetick('x',15,'keeplimits','keepticks')
+    monstr = datestr(plotdat.bincenters(1),21);
+    xlabelstring = sprintf('%s start',monstr);
 else
-   xlabelstring = 'days';
+    xlabelstring = 'days';
 end
 set(get(ax1,'Xlabel'),'String',xlabelstring, ...
-   'Interpreter','none','FontSize',figdata.fontsize)
+    'Interpreter','none','FontSize',figdata.fontsize)
 
 title({plotdat.myregion, plotdat.title, plotdat.subtitle}, ...
       'Interpreter', 'none', 'Fontsize', figdata.fontsize, 'FontWeight', 'bold')
 BottomAnnotation(plotdat)
 
 % create a separate scale for the number of observations
-ax2 = axes('position',get(ax1,'Position'), ...
-   'XAxisLocation','top', ...
-   'YAxisLocation','right', ...
+ax2 = axes( ...
+   'Position',get(ax1,'Position'), ...
+   'FontSize',get(ax1,'FontSize'), ...
+   'XColor'  ,get(ax1,'Xcolor'), ...
+   'XLim'    ,get(ax1,'XLim'), ...
+   'XTick'   ,get(ax1,'XTick'), ...
+   'YDir'    ,get(ax1,'YDir'), ...
    'Color','none', ...
-   'XColor',get(ax1,'Xcolor'), ...
    'YColor','b', ...
-   'FontSize',get(ax1,'FontSize'));
+   'XAxisLocation','top', ...
+   'YAxisLocation','right');
 
 h2 = line(t,nobs_poss,'Color','b','Parent',ax2);
 h3 = line(t,nobs_used,'Color','b','Parent',ax2);
@@ -532,7 +541,7 @@
    end
 end
 
-[~,i,j] = unique(basenames);
+[~,i,~] = unique(basenames);
 y     = cell(length(i),1);
 ydims = cell(length(i),1);
 for k = 1:length(i)

Modified: DART/trunk/diagnostics/matlab/two_experiments_evolution.m
===================================================================
--- DART/trunk/diagnostics/matlab/two_experiments_evolution.m	2016-07-18 21:27:25 UTC (rev 10512)
+++ DART/trunk/diagnostics/matlab/two_experiments_evolution.m	2016-07-18 22:12:25 UTC (rev 10513)
@@ -20,11 +20,11 @@
 %
 % USAGE: two_experiments_evolution(files, titles, obsnames, copy, prpo, 'level', 1)
 %
-% files    : Cell array containing the locations of the obs_diag_output.nc 
+% files    : Cell array containing the locations of the obs_diag_output.nc
 %            files to compare. Each file is presumed to be the results from
 %            a single experiment.
 %
-% titles   : Cell array containing the titles used to annotate each of the experiments. 
+% titles   : Cell array containing the titles used to annotate each of the experiments.
 %
 % obsnames : Cell array containing the strings of each observation type to plot.
 %            Each observation type will be plotted in a separate graphic.
@@ -40,7 +40,7 @@
 %
 % level    : The index of the level to plot. Defaults to level 1.
 %
-% OUTPUT: A .pdf of each graphic is created. Each .pdf has a name that 
+% OUTPUT: A .pdf of each graphic is created. Each .pdf has a name that
 %         reflects the variable, quantity, and region being plotted.
 %
 % EXAMPLE
@@ -74,7 +74,13 @@
 addRequired(p,'obsnames', at iscell);
 addRequired(p,'copy', at ischar);
 addRequired(p,'prpo', at ischar);
-addParamValue(p,'level',default_level, at isnumeric);
+
+if (exist('inputParser/addParameter','file') == 2)
+   addParameter(p,'level',default_level, at isnumeric);
+else
+   addParamValue(p,'level',default_level, at isnumeric);
+end
+
 parse(p, files, titles, obsnames, copy, prpo, varargin{:});
 
 % if you want to echo the input
@@ -478,15 +484,17 @@
 
 % Create another axes to use for plotting the observation counts
 
-ax2 = axes('position',get(ax1,'Position'), ...
-   'XAxisLocation','top', ...
-   'YAxisLocation','right', ...
+ax2 = axes( ...
+   'Position',get(ax1,'Position'), ...
+   'FontSize',get(ax1,'FontSize'), ...
+   'XColor'  ,get(ax1,'XColor'), ...
+   'XLim'    ,get(ax1,'XLim'), ...
+   'XTick'   ,get(ax1,'XTick'), ...
+   'YDir'    ,get(ax1,'YDir'), ...
    'Color','none', ...
-   'XColor',get(ax1,'XColor'), ...
    'YColor','b', ...
-   'XLim',get(ax1,'XLim'), ...
-   'YDir',get(ax1,'YDir'), ...
-   'FontSize',get(ax1,'FontSize'));
+   'XAxisLocation','top', ...
+   'YAxisLocation','right');
 
 % Plot the data, which sets the range of the axis
 for i = 1:Nexp
@@ -580,7 +588,7 @@
    set(h, 'Interpreter', 'none', ...
           'HorizontalAlignment','left', ...
           'FontSize', 8);
-      
+
    % If the observation is trusted for this experiment, annotate as such.
 
    switch lower(plotstruct{ifile}.trusted)


More information about the Dart-dev mailing list