changeset 11204:d2f3a904ac6b

Unset the foreground color for the gnuplot backend earlier (fixes #31533)
author David Bateman <dbateman@free.fr>
date Mon, 08 Nov 2010 07:33:10 +0100
parents d468f5c10955
children abee8cc4820f
files scripts/ChangeLog scripts/plot/__go_draw_axes__.m scripts/plot/__go_draw_figure__.m
diffstat 3 files changed, 21 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/ChangeLog	Sun Nov 07 20:25:25 2010 -0800
+++ b/scripts/ChangeLog	Mon Nov 08 07:33:10 2010 +0100
@@ -1,3 +1,8 @@
+2010-11-08  David Bateman  <dbateman@free.fr>
+
+	* plot/__go_draw_axes__.m: Remove foreground color earlier.
+	* plot/__go_draw_figure__.m: Don't set the foreground color here.
+
 2010-11-08  Rik  <octave@nomad.inbox5.com>
 
 	* sparse/sprand.m: Add input validation to function.
--- a/scripts/plot/__go_draw_axes__.m	Sun Nov 07 20:25:25 2010 -0800
+++ b/scripts/plot/__go_draw_axes__.m	Mon Nov 08 07:33:10 2010 +0100
@@ -23,9 +23,10 @@
 
 ## Author: jwe
 
-function __go_draw_axes__ (h, plot_stream, enhanced, mono, bg_is_set, hlgnd)
+function __go_draw_axes__ (h, plot_stream, enhanced, mono, 
+                           bg_is_set, fg_is_set, hlgnd)
 
-  if (nargin >= 4 && nargin <= 6)
+  if (nargin >= 4 && nargin <= 7)
 
     showhiddenhandles = get (0, "showhiddenhandles");
     unwind_protect
@@ -1514,14 +1515,22 @@
               fputs (plot_stream, "unset obj 1; \\\n");
               bg_is_set = false;
             endif
+            if (fg_is_set)
+              fputs (plot_stream, "unset obj 2; \\\n");
+              fg_is_set = false;
+            endif
           endif
           fprintf (plot_stream, "%s \"-\" %s %s %s \\\n", plot_cmd,
                    usingclause{i}, titlespec{i}, withclause{i});
         elseif (is_image_data (i-1))
           if (bg_is_set)      
             fputs (plot_stream, "unset obj 1; \\\n");
-              bg_is_set = false;
-            endif
+            bg_is_set = false;
+          endif
+          if (fg_is_set)
+            fputs (plot_stream, "unset obj 2; \\\n");
+            fg_is_set = false;
+          endif
           fprintf (plot_stream, "%s \"-\" binary format='%%float64' %s %s %s \\\n", plot_cmd,
                    usingclause{i}, titlespec{i}, withclause{i});
         else
--- a/scripts/plot/__go_draw_figure__.m	Sun Nov 07 20:25:25 2010 -0800
+++ b/scripts/plot/__go_draw_figure__.m	Mon Nov 08 07:33:10 2010 +0100
@@ -117,7 +117,7 @@
                       fprintf (plot_stream, "set border linecolor rgb \"#%02x%02x%02x\"\n", 255 * (1 - bg));
                     endif
                     __go_draw_axes__ (kids(i), plot_stream, enhanced, mono,
-                                      bg_is_set, hlgnd);
+                                      bg_is_set, false, hlgnd);
                   unwind_protect_cleanup
                     ## Return axes "units" and "position" back to
                     ## their original values.
@@ -165,16 +165,14 @@
                     endif
                   endfor
                   __go_draw_axes__ (kids(i), plot_stream, enhanced, mono,
-                                    bg_is_set, hlegend);
+                                    bg_is_set, fg_is_set, hlegend);
                 unwind_protect_cleanup
                   ## Return axes "units" and "position" back to
                   ## their original values.
                   set (kids(i), "units", orig_axes_units);
                   set (kids(i), "position", orig_axes_position);
                   bg_is_set = false;
-                  if (fg_is_set)
-                    fputs (plot_stream, "unset obj 2\n");
-                  endif
+                  fg_is_set = false;
                 end_unwind_protect
               endif
             case "uimenu"