# HG changeset patch # User Kai Habel # Date 1233345152 18000 # Node ID 579f1f54cc3a871518cd18bd095c4827d0f4b46a # Parent fac8c78b4fb9231c748d0bd6b9d14574d37e6524 Add support for transparent surfaces diff --git a/scripts/ChangeLog b/scripts/ChangeLog --- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -1,3 +1,9 @@ +2009-01-30 Kai Habel + + * 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 * time/datestr.m: Convert YYYY to %Y instead of %C%y. diff --git a/scripts/plot/__gnuplot_has_feature__.m b/scripts/plot/__gnuplot_has_feature__.m --- a/scripts/plot/__gnuplot_has_feature__.m +++ b/scripts/plot/__gnuplot_has_feature__.m @@ -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 --git a/scripts/plot/__go_draw_axes__.m b/scripts/plot/__go_draw_axes__.m --- a/scripts/plot/__go_draw_axes__.m +++ b/scripts/plot/__go_draw_axes__.m @@ -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