Mercurial > hg > octave-lyh
diff scripts/plot/plotyy.m @ 17129: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 |
line wrap: on
line diff
--- a/scripts/plot/plotyy.m +++ b/scripts/plot/plotyy.m @@ -115,7 +115,7 @@ [ax, h1, h2] = __plotyy__ (ax, varargin{:}); unwind_protect_cleanup ## Only change back to the old axis if we didn't delete it - if (ishandle (oldh) && strcmp (get (oldh, "type"), "axes")) + if (isaxes (oldh)) axes (oldh); endif end_unwind_protect @@ -142,7 +142,7 @@ xlim = [min([x1(:); x2(:)]), max([x1(:); x2(:)])]; - if (ishandle (ax(1)) && strcmp (get (ax(1), "type"), "axes")) + if (isaxes (ax(1))) axes (ax(1)); else ax(1) = axes (); @@ -157,7 +157,7 @@ cf = gcf (); set (cf, "nextplot", "add"); - if (ishandle (ax(2)) && strcmp (get (ax(2), "type"), "axes")) + if (isaxes (ax(2))) axes (ax(2)); else ax(2) = axes (); @@ -289,7 +289,7 @@ %! ylabel (hax(2), 'Right axis is Green'); function deleteplotyy (h, d, ax2, t2) - if (ishandle (ax2) && strcmp (get (ax2, "type"), "axes") + if (isaxes (ax2) && (isempty (gcbf ()) || strcmp (get (gcbf (), "beingdeleted"),"off")) && strcmp (get (ax2, "beingdeleted"), "off")) set (t2, "deletefcn", []);