diff scripts/plot/colorbar.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 df4c4b7708a4
line wrap: on
line diff
--- a/scripts/plot/colorbar.m	Wed Jul 31 16:23:53 2013 -0700
+++ b/scripts/plot/colorbar.m	Wed Jul 31 16:27:49 2013 -0700
@@ -108,8 +108,7 @@
             error ('colorbar: missing axes handle after "peer"');
           else
             ax = varargin{i++};
-            if (! isscalar (ax) || ! ishandle (ax)
-                || ! strcmp (get (ax, "type"), "axes"))
+            if (! isscalar (ax) && ! isaxes (ax))
               error ('colorbar: expecting an axes handle following "peer"');
             endif
           endif
@@ -253,7 +252,7 @@
 function deletecolorbar (h, d, hc, orig_props)
   ## Don't delete the colorbar and reset the axis size if the
   ## parent figure is being deleted.
-  if (ishandle (hc) && strcmp (get (hc, "type"), "axes")
+  if (isaxes (hc)
       && (isempty (gcbf ()) || strcmp (get (gcbf (), "beingdeleted"), "off")))
     if (strcmp (get (hc, "beingdeleted"), "off"))
       delete (hc);
@@ -272,7 +271,7 @@
 endfunction
 
 function resetaxis (cax, d, ax, orig_props)
-  if (ishandle (ax) && strcmp (get (ax, "type"), "axes"))
+  if (isaxes (ax))
     ## FIXME: Probably don't want to delete everyone's listeners on colormap.
     dellistener (get (ax, "parent"), "colormap");
     dellistener (ax, "clim");
@@ -292,7 +291,7 @@
 endfunction
 
 function update_colorbar_clim (hax, d, hi, vert)
-  if (ishandle (hax) && strcmp (get (hax, "type"), "axes")
+  if (isaxes (hax)
       && (isempty (gcbf ()) || strcmp (get (gcbf (), "beingdeleted"), "off")))
     clen = rows (get (get (hax, "parent"), "colormap"));
     cext = get (hax, "clim");
@@ -331,7 +330,7 @@
 
 function update_colorbar_axis (h, d, cax, orig_props)
 
-  if (ishandle (cax) && strcmp (get (cax, "type"), "axes")
+  if (isaxes (cax)
       && (isempty (gcbf ()) || strcmp (get (gcbf (), "beingdeleted"),"off")))
     loc = get (cax, "location");
     obj = get (h);