[Dart-dev] DART/branches Revision: 12016
dart at ucar.edu
dart at ucar.edu
Wed Oct 25 13:07:14 MDT 2017
thoar at ucar.edu
2017-10-25 13:07:13 -0600 (Wed, 25 Oct 2017)
80
Added support for matlab versions < 2014b.
Still works with versions >= 2014b.
Modified: DART/branches/rma_trunk/diagnostics/matlab/private/FlatEarth.m
===================================================================
--- DART/branches/rma_trunk/diagnostics/matlab/private/FlatEarth.m 2017-10-25 18:46:33 UTC (rev 12015)
+++ DART/branches/rma_trunk/diagnostics/matlab/private/FlatEarth.m 2017-10-25 19:07:13 UTC (rev 12016)
@@ -77,15 +77,24 @@
elseif (plotstruct.Ztype == 3) % zunits = 'height';
end
-% This translates to the right zlevel (no x,y translations)
-htrans = hgtransform;
-htrans.Matrix = makehgtform('translate',[0 0 zlevel]);
+% This translates to the right zlevel (no x,y translations).
+% To set the color of the contours to the lowest color in the colormap
+% add in the value that maps to the lowest color - the bogus data value.
-% to set the color of the contours to the lowest color in the colormap
-% add in the value that maps to the lowest color.
-[c,h] = contourf(x,y,elev+cmin,[cmin cmin],'k-','Parent',htrans);
-set(gca,'CLim',clim)
-
+if ( verLessThan('matlab','8.4') )
+ [~,h] = contourf(x,y,elev+cmin,[cmin cmin],'k-');
+ set(gca,'CLim',clim)
+ t1 = hgtransform('Parent',gca);
+ set(h,'Parent',t1);
+ m = makehgtform('translate',[0 0 zlevel]);
+ set(t1,'Matrix',m)
+else
+ htrans = hgtransform;
+ htrans.Matrix = makehgtform('translate',[0 0 zlevel]);
+ [~,h] = contourf(x,y,elev+cmin,[cmin cmin],'k-','Parent',htrans);
+ set(gca,'CLim',clim)
+end
+
if (orgholdstate == 0), hold off; end;
% <next few lines under version control, do not edit>
More information about the Dart-dev
mailing list