# HG changeset patch # User Rik # Date 1471991659 25200 # Node ID 459545bc901930e068e3046715f5fe774f13061b # Parent 837df5db571082231040755550d241db04758b57 Use ishold () rather than ishold (hax) for performance. * area.m, colorbar.m, contour.m, contourf.m, loglog.m, loglogerr.m, polar.m, __bar__.m, quiver3.m, scatter3.m, semilogx.m, semilogxerr.m, semilogy.m, semilogyerr.m, surf.m, surfl.m: Use ishold () rather than ishold (hax) for performance. diff -r 837df5db5710 -r 459545bc9019 scripts/plot/draw/area.m --- a/scripts/plot/draw/area.m Tue Aug 23 10:12:28 2016 -0700 +++ b/scripts/plot/draw/area.m Tue Aug 23 15:34:19 2016 -0700 @@ -116,7 +116,7 @@ hax = newplot (hax); htmp = __area__ (hax, x, y, bv, varargin{num_numeric+1:end}); - if (! ishold (hax)) + if (! ishold ()) set (hax, "box", "on"); endif diff -r 837df5db5710 -r 459545bc9019 scripts/plot/draw/colorbar.m --- a/scripts/plot/draw/colorbar.m Tue Aug 23 10:12:28 2016 -0700 +++ b/scripts/plot/draw/colorbar.m Tue Aug 23 15:34:19 2016 -0700 @@ -669,6 +669,7 @@ %! ylim ([1, 64]); %! colorbar (); %! colorbar off; +%! title ("colorbar off"); %!demo %! clf; diff -r 837df5db5710 -r 459545bc9019 scripts/plot/draw/contour.m --- a/scripts/plot/draw/contour.m Tue Aug 23 10:12:28 2016 -0700 +++ b/scripts/plot/draw/contour.m Tue Aug 23 15:34:19 2016 -0700 @@ -73,7 +73,7 @@ [ctmp, htmp] = __contour__ (hax, "none", varargin{:}); - if (! ishold (hax)) + if (! ishold ()) set (hax, "box", "on"); endif diff -r 837df5db5710 -r 459545bc9019 scripts/plot/draw/contourf.m --- a/scripts/plot/draw/contourf.m Tue Aug 23 10:12:28 2016 -0700 +++ b/scripts/plot/draw/contourf.m Tue Aug 23 15:34:19 2016 -0700 @@ -74,6 +74,11 @@ [ctmp, htmp] = __contour__ (hax, "none", "fill", "on", "linecolor", "black", varargin{:}); + + if (! ishold ()) + set (hax, "box", "on"); + endif + unwind_protect_cleanup if (! isempty (oldfig)) set (0, "currentfigure", oldfig); diff -r 837df5db5710 -r 459545bc9019 scripts/plot/draw/loglog.m --- a/scripts/plot/draw/loglog.m Tue Aug 23 10:12:28 2016 -0700 +++ b/scripts/plot/draw/loglog.m Tue Aug 23 15:34:19 2016 -0700 @@ -53,7 +53,7 @@ hax = newplot (hax); set (hax, "xscale", "log", "yscale", "log"); - if (! ishold (hax)) + if (! ishold ()) set (hax, "xminortick", "on", "yminortick", "on", "box", "on"); endif diff -r 837df5db5710 -r 459545bc9019 scripts/plot/draw/loglogerr.m --- a/scripts/plot/draw/loglogerr.m Tue Aug 23 10:12:28 2016 -0700 +++ b/scripts/plot/draw/loglogerr.m Tue Aug 23 15:34:19 2016 -0700 @@ -63,7 +63,7 @@ hax = newplot (hax); set (hax, "xscale", "log", "yscale", "log"); - if (! ishold (hax)) + if (! ishold ()) set (hax, "xminortick", "on", "yminortick", "on", "box", "on"); endif htmp = __errplot__ ("loglogerr", hax, varargin{:}); diff -r 837df5db5710 -r 459545bc9019 scripts/plot/draw/polar.m --- a/scripts/plot/draw/polar.m Tue Aug 23 10:12:28 2016 -0700 +++ b/scripts/plot/draw/polar.m Tue Aug 23 15:34:19 2016 -0700 @@ -95,7 +95,7 @@ print_usage (); endif - if (! ishold (hax)) + if (! ishold ()) hg = hggroup (hax, "tag", "polar_grid", "handlevisibility", "off"); set (hax, "visible", "off", "plotboxaspectratio", [1, 1, 1], diff -r 837df5db5710 -r 459545bc9019 scripts/plot/draw/private/__bar__.m --- a/scripts/plot/draw/private/__bar__.m Tue Aug 23 10:12:28 2016 -0700 +++ b/scripts/plot/draw/private/__bar__.m Tue Aug 23 15:34:19 2016 -0700 @@ -195,7 +195,7 @@ htmp = bars (hax, vertical, x, y, xb, yb, gwidth, group, have_line_spec, bv, newargs{:}); - if (! ishold (hax)) + if (! ishold ()) if (all (x(:,1) == fix (x(:,1)))) if (vertical) set (hax, "xtick", x(:,1)); diff -r 837df5db5710 -r 459545bc9019 scripts/plot/draw/quiver3.m --- a/scripts/plot/draw/quiver3.m Tue Aug 23 10:12:28 2016 -0700 +++ b/scripts/plot/draw/quiver3.m Tue Aug 23 15:34:19 2016 -0700 @@ -82,7 +82,7 @@ hax = newplot (hax); htmp = __quiver__ (hax, true, varargin{:}); - if (! ishold (hax)) + if (! ishold ()) set (hax, "view", [-37.5, 30], "xgrid", "on", "ygrid", "on", "zgrid", "on"); endif diff -r 837df5db5710 -r 459545bc9019 scripts/plot/draw/scatter3.m --- a/scripts/plot/draw/scatter3.m Tue Aug 23 10:12:28 2016 -0700 +++ b/scripts/plot/draw/scatter3.m Tue Aug 23 15:34:19 2016 -0700 @@ -82,7 +82,7 @@ htmp = __scatter__ (hax, 3, "scatter3", varargin{:}); - if (! ishold (hax)) + if (! ishold ()) set (hax, "view", [-37.5, 30], "xgrid", "on", "ygrid", "on", "zgrid", "on"); endif diff -r 837df5db5710 -r 459545bc9019 scripts/plot/draw/semilogx.m --- a/scripts/plot/draw/semilogx.m Tue Aug 23 10:12:28 2016 -0700 +++ b/scripts/plot/draw/semilogx.m Tue Aug 23 15:34:19 2016 -0700 @@ -53,7 +53,7 @@ hax = newplot (hax); set (hax, "xscale", "log"); - if (! ishold (hax)) + if (! ishold ()) set (hax, "xminortick", "on", "box", "on"); endif diff -r 837df5db5710 -r 459545bc9019 scripts/plot/draw/semilogxerr.m --- a/scripts/plot/draw/semilogxerr.m Tue Aug 23 10:12:28 2016 -0700 +++ b/scripts/plot/draw/semilogxerr.m Tue Aug 23 15:34:19 2016 -0700 @@ -65,7 +65,7 @@ hax = newplot (hax); set (hax, "xscale", "log"); - if (! ishold (hax)) + if (! ishold ()) set (hax, "xminortick", "on"); endif diff -r 837df5db5710 -r 459545bc9019 scripts/plot/draw/semilogy.m --- a/scripts/plot/draw/semilogy.m Tue Aug 23 10:12:28 2016 -0700 +++ b/scripts/plot/draw/semilogy.m Tue Aug 23 15:34:19 2016 -0700 @@ -53,7 +53,7 @@ hax = newplot (hax); set (hax, "yscale", "log"); - if (! ishold (hax)) + if (! ishold ()) set (hax, "yminortick", "on", "box", "on"); endif diff -r 837df5db5710 -r 459545bc9019 scripts/plot/draw/semilogyerr.m --- a/scripts/plot/draw/semilogyerr.m Tue Aug 23 10:12:28 2016 -0700 +++ b/scripts/plot/draw/semilogyerr.m Tue Aug 23 15:34:19 2016 -0700 @@ -65,7 +65,7 @@ hax = newplot (hax); set (hax, "yscale", "log"); - if (! ishold (hax)) + if (! ishold ()) set (hax, "yminortick", "on"); endif diff -r 837df5db5710 -r 459545bc9019 scripts/plot/draw/surf.m --- a/scripts/plot/draw/surf.m Tue Aug 23 10:12:28 2016 -0700 +++ b/scripts/plot/draw/surf.m Tue Aug 23 15:34:19 2016 -0700 @@ -71,7 +71,7 @@ htmp = surface (varargin{:}); - if (! ishold (hax)) + if (! ishold ()) set (hax, "view", [-37.5, 30], "xgrid", "on", "ygrid", "on", "zgrid", "on"); endif diff -r 837df5db5710 -r 459545bc9019 scripts/plot/draw/surfl.m --- a/scripts/plot/draw/surfl.m Tue Aug 23 10:12:28 2016 -0700 +++ b/scripts/plot/draw/surfl.m Tue Aug 23 15:34:19 2016 -0700 @@ -144,7 +144,7 @@ hax = newplot (hax); htmp = surface (varargin{:}); - if (! ishold (hax)) + if (! ishold ()) set (hax, "view", [-37.5, 30], "xgrid", "on", "ygrid", "on", "zgrid", "on", "clim", [0 1]); endif