[Dart-dev] DART/branches Revision: 11776

dart at ucar.edu dart at ucar.edu
Tue Jun 27 12:52:28 MDT 2017


thoar at ucar.edu
2017-06-27 12:52:27 -0600 (Tue, 27 Jun 2017)
281
Removing the use of an integer to specify the legend location in favor
of the attribute/value pair of   'Location','Northeast' (for example).
More recent versions of Matlab have deprecated the use of the integer
specification and threw a warning. Tested with 2014a through 2017a.




Modified: DART/branches/rma_trunk/diagnostics/matlab/private/PlotEnsErrSpread.m
===================================================================
--- DART/branches/rma_trunk/diagnostics/matlab/private/PlotEnsErrSpread.m	2017-06-27 18:04:54 UTC (rev 11775)
+++ DART/branches/rma_trunk/diagnostics/matlab/private/PlotEnsErrSpread.m	2017-06-27 18:52:27 UTC (rev 11776)
@@ -96,7 +96,7 @@
                     pinfo.time,ens_spread(:, ivar), 'r');
                 s1 = sprintf('%s model Var %d Ensemble Error Spread', pinfo.model, ivar);
                 title({s1,pinfo.diagn_file},'interpreter','none','fontweight','bold')
-                legend(string1,string2,0)
+                legend(string1,string2,'Location','NorthEast')
                 legend boxoff
                 xlabel(sprintf('model "days" (%d timesteps)',pinfo.time_series_length))
                 ylabel('distance')
@@ -140,7 +140,7 @@
                 pinfo.time,ens_spread(:,ivar), 'r');
             s1 = sprintf('%s model Var %d Ensemble Error Spread', pinfo.model, ivar);
             title({s1,pinfo.diagn_file},'interpreter','none','fontweight','bold')
-            legend(string1,string2,0)
+            legend(string1,string2,'Location','NorthEast')
             legend boxoff
             xlabel(sprintf('model "days" (%d timesteps)',pinfo.time_series_length))
             ylabel('distance')
@@ -196,7 +196,7 @@
             pinfo.level, pinfo.latitude, pinfo.longitude);
         title({s1, s2, pinfo.diagn_file},'interpreter','none','fontweight','bold');
         
-        legend(string1,string2,0);
+        legend(string1,string2,'Location','NorthEast');
         legend boxoff
         xdates(pinfo.time);
         ylabel('distance');
@@ -248,7 +248,7 @@
             pinfo.level, pinfo.latCell(pinfo.cellindex), pinfo.lonCell(pinfo.cellindex));
         title({s1, s2, pinfo.diagn_file},'interpreter','none','fontweight','bold');
         
-        legend(string1,string2,0);
+        legend(string1,string2,'Location','NorthEast');
         legend boxoff
         xdates(pinfo.time);
         ylabel('distance');

Modified: DART/branches/rma_trunk/diagnostics/matlab/private/PlotEnsMeanTimeSeries.m
===================================================================
--- DART/branches/rma_trunk/diagnostics/matlab/private/PlotEnsMeanTimeSeries.m	2017-06-27 18:04:54 UTC (rev 11775)
+++ DART/branches/rma_trunk/diagnostics/matlab/private/PlotEnsMeanTimeSeries.m	2017-06-27 18:52:27 UTC (rev 11776)
@@ -83,9 +83,9 @@
             plot(pinfo.time,ens_mean,'r','LineWidth',1.0)
 
             if (exist('legendstr','var'))
-               legend(legendstr,'Ensemble Mean',0)
+               legend(legendstr,'Ensemble Mean','Location','NorthEast')
             else
-               legend('Ensemble Mean',0)
+               legend('Ensemble Mean','Location','NorthEast')
             end
 
             title(sprintf('%s Variable %d of %s',pinfo.model,ivar,pinfo.diagn_file), ...
@@ -111,7 +111,7 @@
                            'tindex1',pinfo.diagn_time(1),...
                            'tcount',pinfo.diagn_time(2));
             plot(pinfo.time, ens_mean, 'r');
-            legend(sprintf('Ensemble Mean %f',mean(ens_mean)),0)
+            legend(sprintf('Ensemble Mean %f',mean(ens_mean)),'Location','NorthEast')
 
             if ( have_truth )
                truth = get_hyperslab('fname',pinfo.truth_file, ...
@@ -122,7 +122,7 @@
                            'tcount',pinfo.truth_time(2));
                hold on; plot(pinfo.time,truth,'b'); hold off;
                legend(sprintf('Ensemble Mean %f',mean(ens_mean)),...
-                      sprintf('True State %f',mean(truth)),0)
+                      sprintf('True State %f',mean(truth)),'Location','NorthEast')
             end
 
             s1 = sprintf('%s Variable %d',pinfo.model,ivar);
@@ -138,7 +138,7 @@
                  'tindex1',pinfo.diagn_time(1), ...
                  'tcount',pinfo.diagn_time(2));
       plot3(ens(1,:), ens(2,:), ens(3,:), 'r')
-      legend('Ensemble Mean',0)
+      legend('Ensemble Mean','Location','NorthEast')
 
       if (have_truth)
          ts= get_hyperslab('fname',pinfo.truth_file, ...
@@ -146,7 +146,7 @@
                  'tindex1',pinfo.truth_time(1), ...
                  'tcount',pinfo.truth_time(2));
          hold on; plot3(  ts(1,:),  ts(2,:),  ts(3,:), 'b'); hold off;
-         legend('Ensemble Mean','True State',0)
+         legend('Ensemble Mean','True State','Location','NorthEast')
       end
 
       [~,fname,fext] = fileparts(pinfo.diagn_file);
@@ -173,7 +173,7 @@
                            'tindex1',pinfo.diagn_time(1), ...
                            'tcount',pinfo.diagn_time(2));
             plot(pinfo.time, ens_mean, 'r')
-            legend(sprintf('Ensemble Mean %f',mean(ens_mean)),0)
+            legend(sprintf('Ensemble Mean %f',mean(ens_mean)),'Location','NorthEast')
 
             % Get the truth for this variable


More information about the Dart-dev mailing list