changeset 8171:15ffb9836c01

__go_draw_axes__.m: Remove depdenence on gnuplot version.
author Ben Abbott <bpabbott@mac.com>
date Thu, 02 Oct 2008 12:43:47 -0400
parents 1651939a394b
children 9ba45b125ee8
files scripts/ChangeLog scripts/plot/__go_draw_axes__.m
diffstat 2 files changed, 10 insertions(+), 46 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/ChangeLog	Wed Oct 01 11:34:45 2008 -0400
+++ b/scripts/ChangeLog	Thu Oct 02 12:43:47 2008 -0400
@@ -1,3 +1,7 @@
+2008-10-02  Ben Abbott <bpabbott@mac.com>
+
+	* plot/__go_draw_axes__.m: Remove depdenence on gnuplot version..
+
 2008-09-30  Jaroslav Hajek  <highegg@gmail.com>
 
 	* string/split.m: New tests.
--- a/scripts/plot/__go_draw_axes__.m	Wed Oct 01 11:34:45 2008 -0400
+++ b/scripts/plot/__go_draw_axes__.m	Thu Oct 02 12:43:47 2008 -0400
@@ -24,16 +24,6 @@
 
   if (nargin == 4)
 
-    ## Gnupot versions > 4.2.4 include a patch to properly interpolate
-    ## colors.  Prior to that version the interpolation of colors used
-    ## the zdata rather than the cdata.
-    ##
-    ## FIXME: when gnuplot 4.3 is released the special treatment might
-    ## be removed.
-
-    persistent gp_version_gt_4p2p4 = ...
-	compare_versions (__gnuplot_version__ (), "4.2.4", ">");
-
     axis_obj = __get__ (h);
 
     parent_figure_obj = get (axis_obj.parent);
@@ -325,25 +315,9 @@
 	continue;
       endif
 
-      ## Check for color interpolation for surfaces.
-      doing_interp_color = strncmp (obj.facecolor, "interp", 6);
-      if (doing_interp_color)
-	## Check to see if gnuplot is fully functional in this regard.
-	if (gp_version_gt_4p2p4)
-	  ## Color interpolation works correctly in gnuplot >4.2.4.
-	  fake_color_interp = false;
-	else
-	  ## The patches may be applied to >4.2.2, but don't count on it.
-	  ## For versions >4.1 & <4.2.5 the interpolation uses the zdata
-	  ## rather than the cdata. As a result surfc() will work because
-	  ## all(zdata(:)==cdata(:)). pcolor() may be given the illusion
-	  ## of working when the veiw is directly from above.
-	  fake_color_interp = (all (axis_obj.view == [0, 90])
-			       || all (obj.zdata(:) == obj.cdata(:)));
-	endif
-      else
-        fake_color_interp = false;
-      endif
+      ## Check for facecolor interpolation for surfaces.
+      doing_interp_color = ...
+         isfield (obj, "facecolor") && strncmp (obj.facecolor, "interp", 6);
 
       switch (obj.type)
 	case "image"
@@ -848,19 +822,11 @@
 
 	    if (doing_interp_color)
 	      interp_str = "interpolate 4, 4";
-	      if (fake_color_interp)
-		## In this instance the interpolation of color respects zdata
-		## rather than cdata.
-		usingclause{data_idx} = "using ($1):($2):($4)";
-	      else
-	        ## The proper gnuplot inputs include xdata, ydata, zdata, & cdata.
-		usingclause{data_idx} = "using ($1):($2):($3):($4)";
-	      endif
 	    else
-	      ## No interpolation of colors.
+	      ## No interpolation of facecolors.
 	      interp_str = "";
-	      usingclause{data_idx} = "using ($1):($2):($3):($4)";
 	    endif
+	    usingclause{data_idx} = "using ($1):($2):($3):($4)";
 
             flat_interp_face = (strncmp (obj.facecolor, "flat", 4)
 				|| strncmp (obj.facecolor, "interp", 6));
@@ -1027,13 +993,7 @@
       else
 	zdir = "noreverse";
       endif
-      if (doing_interp_color)
-	if (! fake_color_interp || any (obj.zdata(:) ~= 0))
-	  fprintf (plot_stream, "set zrange [%.15e:%.15e] %s;\n", zlim, zdir);
-	end
-      else
-	fprintf (plot_stream, "set zrange [%.15e:%.15e] %s;\n", zlim, zdir);
-      endif
+      fprintf (plot_stream, "set zrange [%.15e:%.15e] %s;\n", zlim, zdir);
     endif
 
     cmap = parent_figure_obj.colormap;