changeset 8645:579f1f54cc3a

Add support for transparent surfaces
author Kai Habel
date Fri, 30 Jan 2009 14:52:32 -0500
parents fac8c78b4fb9
children e01c6355304f
files scripts/ChangeLog scripts/plot/__gnuplot_has_feature__.m scripts/plot/__go_draw_axes__.m
diffstat 3 files changed, 21 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/ChangeLog	Fri Jan 30 14:43:46 2009 -0500
+++ b/scripts/ChangeLog	Fri Jan 30 14:52:32 2009 -0500
@@ -1,3 +1,9 @@
+2009-01-30  Kai Habel  <kai.habel@gmx.de>
+
+	* plot/__go_draw_axes__.m: Add support for transparent surfaces.
+	* plot/__gnuplot_has_feature__.m: Add feature 'transparent_surface',
+	Require gnuplot 4.3 for transparent patches and surfaces.
+
 2009-01-30  Benjamin Lindner  <lindnerben@gmx.net>
 
 	* time/datestr.m: Convert YYYY to %Y instead of %C%y.
--- a/scripts/plot/__gnuplot_has_feature__.m	Fri Jan 30 14:43:46 2009 -0500
+++ b/scripts/plot/__gnuplot_has_feature__.m	Fri Jan 30 14:52:32 2009 -0500
@@ -26,13 +26,14 @@
   persistent features has_features
   features = {"x11_figure_position",
               "transparent_patches",
+              "transparent_surface",
               "epslatex_implies_eps_filesuffix",
               "epslatexstandalone_terminal"};
 
   if (isempty (has_features))
     gnuplot_version = __gnuplot_version__ ();
-    versions = {"4.2.4", "4.2.4", "4.2", "4.2"};
-    operators = {">", ">", ">=", ">="};
+    versions = {"4.2.4", "4.3", "4.3", "4.2", "4.2"};
+    operators = {">", ">=", ">=", ">=", ">="};
     have_features = logical (zeros (size (features)));
     for n = 1 : numel (have_features)
       has_features(n) = compare_versions (gnuplot_version, versions{n}, operators{n});
--- a/scripts/plot/__go_draw_axes__.m	Fri Jan 30 14:43:46 2009 -0500
+++ b/scripts/plot/__go_draw_axes__.m	Fri Jan 30 14:52:32 2009 -0500
@@ -875,6 +875,12 @@
 		       interp_str, dord);
             elseif (!facecolor_none_or_white)
               if (strncmp (obj.edgecolor, "none", 4))
+                if (__gnuplot_has_feature__ ("transparent_surface") 
+                    && isscalar (obj.facealpha))
+                  fprintf (plot_stream,
+                           "set style fill transparent solid %f;\n",
+                           obj.facealpha);
+                endif
                 fprintf (plot_stream, "set pm3d explicit at s %s corners2color c3;\n", 
 			 interp_str, dord);
               else
@@ -894,6 +900,12 @@
                 fprintf (plot_stream,
                          "set style line %d %s lw %f;\n",
                          data_idx, colorspec, obj.linewidth);
+                if (__gnuplot_has_feature__ ("transparent_surface") 
+                    && isscalar (obj.facealpha))
+                  fprintf (plot_stream,
+                           "set style fill transparent solid %f;\n",
+                           obj.facealpha);
+                endif
               endif
             endif
 	  endif