[Dart-dev] DART/branches Revision: 13092
dart at ucar.edu
dart at ucar.edu
Mon Apr 1 13:12:04 MDT 2019
thoar at ucar.edu
2019-04-01 13:12:04 -0600 (Mon, 01 Apr 2019)
255
works with 2015b and 2018b
Fixing Matlab's non-backwards compatible changes. With 2017a, for example,
the legend object has a property that automatically adds every line to the legend.
This is not what we want, and is not what was done prior to 2017a.
Modified: DART/branches/qc8diags/diagnostics/matlab/plot_bias_xxx_profile.m
===================================================================
--- DART/branches/qc8diags/diagnostics/matlab/plot_bias_xxx_profile.m 2019-03-29 20:48:08 UTC (rev 13091)
+++ DART/branches/qc8diags/diagnostics/matlab/plot_bias_xxx_profile.m 2019-04-01 19:12:04 UTC (rev 13092)
@@ -66,7 +66,7 @@
if (exist('inputParser/addParameter','file') == 2)
addParameter(p,'obsname',default_obsname, at ischar);
else
- addParamValue(p,'obsname',default_obsname, at ischar);
+ addParamValue(p,'obsname',default_obsname, at ischar); %#ok<NVREPL>
end
p.parse(fname, copy, varargin{:});
@@ -270,7 +270,6 @@
sum(sum(guess(plotdat.NQC6index, :,:))),plotdat.myvarname)
fprintf('%10d %s observations had DART QC of 7 (all regions).\n', ...
sum(sum(guess(plotdat.NQC7index, :,:))),plotdat.myvarname)
-
if (plotdat.NQC8index > 0)
fprintf('%10d %s observations had DART QC of 8 (all regions).\n', ...
sum(sum(guess(plotdat.NQC8index, :,:))),plotdat.myvarname)
@@ -394,7 +393,6 @@
% draw the result of the experiment
-hold on;
h1 = line(ges_bias,plotdat.level);
h2 = line(ges_copy,plotdat.level);
@@ -431,9 +429,16 @@
set(h,'Interpreter','none','Box','off')
-hold off;
+if verLessThan('matlab','R2017a')
+ % Convince Matlab to not autoupdate the legend with each new line.
+ % Before 2017a, this was the default behavior, so do nothing.
+ % We do not want to add the bias line to the legend, for example.
+else
+ h.AutoUpdate = 'off';
+end
-zeroline = line([0 0],plotdat.Yrange,'Color',[0 100 0]/255,'Parent',ax1);
+% Want a zeroline for bias plots.
+zeroline = line([0 0],plotdat.Yrange,'Color',[200 200 200]/255,'Parent',ax1);
set(zeroline,'LineWidth',2.5,'LineStyle','-')
% If the observation is trusted, reference that somehow
@@ -540,7 +545,7 @@
for i = 1:length(x.allvarnames)
dimnames = lower(x.allvardims{i});
- if (isempty(strfind(dimnames,'time')))
+ if (isempty(strfind(dimnames,'time'))) %#ok<STREMP>
platform = ReturnBase(x.allvarnames{i});
if (~ isempty(platform))
j = j + 1;
@@ -710,7 +715,7 @@
hold on;
for i = 1:2:(length(edges)-1)
yc = [ edges(i) edges(i) edges(i+1) edges(i+1) edges(i) ];
- hf = fill(xc,yc,[0.8 0.8 0.8],'EdgeColor','none');
+ fill(xc,yc,[0.8 0.8 0.8],'EdgeColor','none');
end
hold off;
Modified: DART/branches/qc8diags/diagnostics/matlab/plot_evolution.m
===================================================================
--- DART/branches/qc8diags/diagnostics/matlab/plot_evolution.m 2019-03-29 20:48:08 UTC (rev 13091)
+++ DART/branches/qc8diags/diagnostics/matlab/plot_evolution.m 2019-04-01 19:12:04 UTC (rev 13092)
@@ -25,15 +25,17 @@
%
% copy : string defining the metric of interest. 'rmse', 'spread', etc.
% Possible values are available in the netcdf 'CopyMetaData' variable.
-% (ncdump -v CopyMetaData obs_diag_output.nc)%
+% (ncdump -v CopyMetaData obs_diag_output.nc)
%
-% obsname : Optional. If present, The strings of each observation type to plot.
+% varargin: optional, parameter-value pairs. Supported parameters are described below.
+%
+% obsname : The strings of each observation type to plot.
% Each observation type will be plotted in a separate graphic.
% Default is to plot all available observation types.
%
-% level : Optional. 'level' index. Default is to plot all levels.
+% level : 'level' index. Default is to plot all levels.
%
-% range : Optional. 'range' of the value being plotted. Default is to
+% range : 'range' of the value being plotted. Default is to
% automatically determine range based on the data values.
%
% OUTPUT: 'plotdat' is a structure containing what was last plotted.
@@ -71,34 +73,33 @@
%
% DART $Id$
+default_obsname = 'none';
+default_range = [NaN NaN];
default_level = -1;
-default_obsname = 'none';
More information about the Dart-dev
mailing list