[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
transparent surfaces
From: |
Kai Habel |
Subject: |
transparent surfaces |
Date: |
Fri, 30 Jan 2009 18:46:21 +0100 |
User-agent: |
Thunderbird 2.0.0.19 (X11/20081227) |
Hello all,
the attached patch enables transparent surfaces as well. It requires
gnuplot 4.3. In addtion I have increased the requirements for
'transparent_patches' to >= gnuplot 4.3 since I don't think these
features will be backported to the 4.2. series.
Kai
s=surf(peaks)
set(s,'facealpha',0.5)
set(s,'edgecolor','none')
# HG changeset patch
# User Kai Habel
# Date 1233337124 -3600
# Node ID 98fb4f837962c70e0b7f357fc17914f87d110cf5
# Parent 4385bb503467d6cbd834378dd4023b1f5052b858
Add support for transparent surfaces
diff -r 4385bb503467 -r 98fb4f837962 scripts/ChangeLog
--- a/scripts/ChangeLog Thu Jan 29 18:13:06 2009 -0500
+++ b/scripts/ChangeLog Fri Jan 30 18:38:44 2009 +0100
@@ -1,3 +1,9 @@
+2009-01-30 Kai Habel <address@hidden>
+
+ * 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-29 John W. Eaton <address@hidden>
* miscellaneous/fileparts.m: Match all possible file separators.
diff -r 4385bb503467 -r 98fb4f837962 scripts/plot/__gnuplot_has_feature__.m
--- a/scripts/plot/__gnuplot_has_feature__.m Thu Jan 29 18:13:06 2009 -0500
+++ b/scripts/plot/__gnuplot_has_feature__.m Fri Jan 30 18:38:44 2009 +0100
@@ -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});
diff -r 4385bb503467 -r 98fb4f837962 scripts/plot/__go_draw_axes__.m
--- a/scripts/plot/__go_draw_axes__.m Thu Jan 29 18:13:06 2009 -0500
+++ b/scripts/plot/__go_draw_axes__.m Fri Jan 30 18:38:44 2009 +0100
@@ -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
- transparent surfaces,
Kai Habel <=