# HG changeset patch # User David Bateman # Date 1289197990 -3600 # Node ID d2f3a904ac6b91286aa01164f56bfda1c21bcc19 # Parent d468f5c1095595ac89261190373a7e7910a92fb6 Unset the foreground color for the gnuplot backend earlier (fixes #31533) diff --git a/scripts/ChangeLog b/scripts/ChangeLog --- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -1,3 +1,8 @@ +2010-11-08 David Bateman + + * 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 * sparse/sprand.m: Add input validation to function. 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 @@ -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 diff --git a/scripts/plot/__go_draw_figure__.m b/scripts/plot/__go_draw_figure__.m --- a/scripts/plot/__go_draw_figure__.m +++ b/scripts/plot/__go_draw_figure__.m @@ -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"