Mercurial > hg > octave-lyh
changeset 10507:424795ef82b8
__go_draw_figure__.m: Don't set background for non-visible axes.
author | Ben Abbott <bpabbott@mac.com> |
---|---|
date | Sat, 10 Apr 2010 19:53:28 -0400 |
parents | bdf5d85cfc5e |
children | 9a5e2d13fa5a |
files | scripts/ChangeLog scripts/plot/__go_draw_figure__.m |
diffstat | 2 files changed, 44 insertions(+), 38 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -1,3 +1,7 @@ +2010-04-10 Ben Abbott <bpabbot@mac.com> + + * plot/__go_draw_figure__.m: Don't set background for non-visible axes. + 2010-04-07 John W. Eaton <jwe@octave.org> * testfun/runtests.m: New function.
--- a/scripts/plot/__go_draw_figure__.m +++ b/scripts/plot/__go_draw_figure__.m @@ -77,44 +77,46 @@ bg_is_set = false; endif for i = nkids:-1:1 - 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); - else - ## Return axes "units" and "position" back to their original values. - __go_draw_axes__ (kids(i), plot_stream, enhanced, mono, implicit_margin); - endif - unwind_protect_cleanup - set (kids(i), "units", orig_axes_units); - set (kids(i), "position", orig_axes_position); - if (fg_is_set) - fputs (plot_stream, "unset obj 2\n"); - endif - if (bg_is_set) - fputs (plot_stream, "unset obj 1\n"); - bg_is_set = false; - endif - end_unwind_protect - otherwise - error ("__go_draw_figure__: unknown object class, %s", type); - endswitch + 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); + else + ## Return axes "units" and "position" back to their original values. + __go_draw_axes__ (kids(i), plot_stream, enhanced, mono, implicit_margin); + endif + unwind_protect_cleanup + set (kids(i), "units", orig_axes_units); + set (kids(i), "position", orig_axes_position); + if (fg_is_set) + fputs (plot_stream, "unset obj 2\n"); + endif + if (bg_is_set) + fputs (plot_stream, "unset obj 1\n"); + bg_is_set = false; + endif + end_unwind_protect + otherwise + error ("__go_draw_figure__: unknown object class, %s", type); + endswitch + endif endfor fputs (plot_stream, "\nunset multiplot;\n"); else