changeset 8915:485eabc0cfec

__go_draw_axes__.m: Preserve the order of axes' children when pruning the handles for the {x,y,z}labels and title.
author Ben Abbott <bpabbott@mac.com>
date Fri, 06 Mar 2009 01:07:04 -0500
parents 354179c24c79
children a2878ba31a9e
files scripts/ChangeLog scripts/plot/__go_draw_axes__.m scripts/plot/legend.m
diffstat 3 files changed, 14 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- 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 <bpabbott@mac.com>
+
+	* 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  <highegg@gmail.com>
 
 	* linear-algebra/condest.m: Use lu rather than splu. Use relative tols
--- 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");
--- 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")