diff scripts/plot/legend.m @ 17125:b5d6314314fc

Change various plot functions to take advantage of new isaxes() function. * scripts/geometry/voronoi.m, scripts/image/imagesc.m, scripts/plot/__plt_get_axis_arg__.m, scripts/plot/axes.m, scripts/plot/cla.m, scripts/plot/colorbar.m, scripts/plot/hold.m, scripts/plot/legend.m, scripts/plot/plotmatrix.m, scripts/plot/plotyy.m, scripts/plot/private/__errplot__.m, scripts/plot/private/__plt__.m, scripts/plot/view.m: Use new isaxes function to simplify code. * scripts/plot/shading.m: Use Octave convention for spacing of parentheses. * scripts/plot/zlabel.m: Correct %!test incorrectly calling plot3 with figure handle.
author Rik <rik@octave.org>
date Wed, 31 Jul 2013 16:27:49 -0700
parents eaab03308c0b
children c3c1ebfaa7dc
line wrap: on
line diff
--- a/scripts/plot/legend.m	Wed Jul 31 16:23:53 2013 -0700
+++ b/scripts/plot/legend.m	Wed Jul 31 16:27:49 2013 -0700
@@ -253,8 +253,8 @@
   hlegend = [];
   fkids = get (fig, "children");
   for i = 1 : numel (fkids)
-    if (ishandle (fkids(i)) && strcmp (get (fkids(i), "type"), "axes")
-        && (strcmp (get (fkids(i), "tag"), "legend")))
+    if (   strcmp (get (fkids(i), "type"), "axes")
+        && strcmp (get (fkids(i), "tag"), "legend"))
       udata = get (fkids(i), "userdata");
       if (! isempty (intersect (udata.handle, ca)))
         hlegend = fkids(i);
@@ -1059,7 +1059,7 @@
   endif
 
   for i = 1 : numel (ca)
-    if (ishandle (ca(i)) && strcmp (get (ca(i), "type"), "axes")
+    if (isaxes (ca(i))
         && (isempty (gcbf ()) || strcmp (get (gcbf (), "beingdeleted"),"off"))
         && strcmp (get (ca(i), "beingdeleted"), "off"))
       units = get (ca(i), "units");
@@ -1078,7 +1078,7 @@
 endfunction
 
 function deletelegend1 (h, d, ca)
-  if (ishandle (ca) && strcmp (get (ca, "type"), "axes")
+  if (isaxes (ca)
       && (isempty (gcbf ()) || strcmp (get (gcbf (), "beingdeleted"), "off"))
       && strcmp (get (ca, "beingdeleted"), "off"))
     delete (ca);
@@ -1087,7 +1087,7 @@
 
 function deletelegend2 (h, d, ca, pos, outpos, t1, hplots)
   for i = 1 : numel (ca)
-    if (ishandle (ca(i)) && strcmp (get (ca(i), "type"), "axes")
+    if (isaxes (ca(i))
         && (isempty (gcbf ()) || strcmp (get (gcbf (), "beingdeleted"), "off"))
         && strcmp (get (ca(i), "beingdeleted"), "off"))
       if (!isempty (pos) && !isempty(outpos))