# HG changeset patch # User Ben Abbott # Date 1236319624 18000 # Node ID 485eabc0cfece1d0b97ce7d21c72ca9a3e7de62a # Parent 354179c24c79dcd00c2d14ca318661f0ba0d0929 __go_draw_axes__.m: Preserve the order of axes' children when pruning the handles for the {x,y,z}labels and title. diff -r 354179c24c79 -r 485eabc0cfec scripts/ChangeLog --- a/scripts/ChangeLog Thu Mar 05 21:50:59 2009 +0100 +++ b/scripts/ChangeLog Fri Mar 06 01:07:04 2009 -0500 @@ -1,3 +1,10 @@ +2009-03-06 Ben Abbott + + * plot/__go_draw_axes__.m: Preserve the order of axes' children + when pruning the handles for the {x,y,z}labels and title. + * plot/legend.m: Change demo to add colors to lines. This change + reveals the problem (above) with the ordering of the axes' children. + 2009-03-05 Jaroslav Hajek * linear-algebra/condest.m: Use lu rather than splu. Use relative tols diff -r 354179c24c79 -r 485eabc0cfec scripts/plot/__go_draw_axes__.m --- a/scripts/plot/__go_draw_axes__.m Thu Mar 05 21:50:59 2009 +0100 +++ b/scripts/plot/__go_draw_axes__.m Fri Mar 06 01:07:04 2009 -0500 @@ -294,8 +294,11 @@ fputs (plot_stream, "set clip two;\n"); kids = axis_obj.children; - kids = setdiff (kids, [axis_obj.xlabel; axis_obj.ylabel; ... - axis_obj.zlabel; axis_obj.title]); + ## Remove the axis labels and title from the children, and + ## preserved the original order. + [jnk, k] = setdiff (kids, [axis_obj.xlabel; axis_obj.ylabel; ... + axis_obj.zlabel; axis_obj.title]); + kids = kids (sort (k)); if (nd == 3) fputs (plot_stream, "set parametric;\n"); diff -r 354179c24c79 -r 485eabc0cfec scripts/plot/legend.m --- a/scripts/plot/legend.m Thu Mar 05 21:50:59 2009 +0100 +++ b/scripts/plot/legend.m Fri Mar 06 01:07:04 2009 -0500 @@ -243,7 +243,8 @@ %! clf %! labels = {}; %! for i = 1:5 -%! plot(1:100, i + rand(100,1)); hold on; +%! h = plot(1:100, i + rand(100,1)); hold on; +%! set (h, "color", get (gca, "colororder")(i,:)) %! labels = {labels{:}, cstrcat("Signal ", num2str(i))}; %! endfor; hold off; %! title("Signals with random offset and uniform noise")