# HG changeset patch # User Ben Abbott # Date 1272204292 14400 # Node ID 046b713d21dc3d73cd9eba2c6c1d6a030f9fe030 # Parent 79410269cd21dfe6714dba5a6f5d25d43a7b09df __go_draw_figure__.m: Hidden axes may have visible children. diff -r 79410269cd21 -r 046b713d21dc scripts/ChangeLog --- a/scripts/ChangeLog Sat Apr 24 19:48:36 2010 -0400 +++ b/scripts/ChangeLog Sun Apr 25 10:04:52 2010 -0400 @@ -1,3 +1,7 @@ +2010-04-25 Ben Abbott + + * plot/__go_draw_figure__.m: Hidden axes may have visible children. + 2010-04-24 Ben Abbott * plot/print.m: Set figure color property to 'none' when printing. diff -r 79410269cd21 -r 046b713d21dc scripts/plot/__go_draw_figure__.m --- a/scripts/plot/__go_draw_figure__.m Sat Apr 24 19:48:36 2010 -0400 +++ b/scripts/plot/__go_draw_figure__.m Sun Apr 25 10:04:52 2010 -0400 @@ -77,43 +77,41 @@ bg_is_set = false; endif for i = nkids:-1:1 - if (strcmp (get (kids(i), "visible"), "on")) - type = get (kids(i), "type"); - switch (type) - case "axes" - ## Rely upon listener to convert axes position to "normalized" units. - orig_axes_units = get (kids(i), "units"); - orig_axes_position = get (kids(i), "position"); - unwind_protect - set (kids(i), "units", "normalized"); - fg = get (kids(i), "color"); - if (isnumeric (fg)) - fprintf (plot_stream, "set obj 2 rectangle from graph 0,0 to graph 1,1 behind fc rgb \"#%02x%02x%02x\"\n", 255 * fg); - fg_is_set = true; - else - fg_is_set = false; - endif - if (output_to_paper) - axes_position_on_page = orig_axes_position .* paper_position([3, 4, 3 ,4]); - axes_position_on_page(1:2) = axes_position_on_page(1:2) + paper_position(1:2); - set (kids(i), "position", axes_position_on_page); - __go_draw_axes__ (kids(i), plot_stream, enhanced, mono, implicit_margin, bg_is_set); - else - ## Return axes "units" and "position" back to their original values. - __go_draw_axes__ (kids(i), plot_stream, enhanced, mono, implicit_margin, bg_is_set); - endif - unwind_protect_cleanup - 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 - end_unwind_protect - otherwise - error ("__go_draw_figure__: unknown object class, %s", type); - endswitch - endif + type = get (kids(i), "type"); + switch (type) + case "axes" + ## Rely upon listener to convert axes position to "normalized" units. + orig_axes_units = get (kids(i), "units"); + orig_axes_position = get (kids(i), "position"); + unwind_protect + set (kids(i), "units", "normalized"); + fg = get (kids(i), "color"); + if (isnumeric (fg) && strcmp (get (kids(i), "visible"), "on")) + fprintf (plot_stream, "set obj 2 rectangle from graph 0,0 to graph 1,1 behind fc rgb \"#%02x%02x%02x\"\n", 255 * fg); + fg_is_set = true; + else + fg_is_set = false; + endif + if (output_to_paper) + axes_position_on_page = orig_axes_position .* paper_position([3, 4, 3 ,4]); + axes_position_on_page(1:2) = axes_position_on_page(1:2) + paper_position(1:2); + set (kids(i), "position", axes_position_on_page); + __go_draw_axes__ (kids(i), plot_stream, enhanced, mono, implicit_margin, bg_is_set); + else + ## Return axes "units" and "position" back to their original values. + __go_draw_axes__ (kids(i), plot_stream, enhanced, mono, implicit_margin, bg_is_set); + endif + unwind_protect_cleanup + 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 + end_unwind_protect + otherwise + error ("__go_draw_figure__: unknown object class, %s", type); + endswitch endfor fputs (plot_stream, "\nunset multiplot;\n"); else