changeset 22367:459545bc9019

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.
author Rik <rik@octave.org>
date Tue, 23 Aug 2016 15:34:19 -0700
parents 837df5db5710
children 3dc8764e3bd5
files scripts/plot/draw/area.m scripts/plot/draw/colorbar.m scripts/plot/draw/contour.m scripts/plot/draw/contourf.m scripts/plot/draw/loglog.m scripts/plot/draw/loglogerr.m scripts/plot/draw/polar.m scripts/plot/draw/private/__bar__.m scripts/plot/draw/quiver3.m scripts/plot/draw/scatter3.m scripts/plot/draw/semilogx.m scripts/plot/draw/semilogxerr.m scripts/plot/draw/semilogy.m scripts/plot/draw/semilogyerr.m scripts/plot/draw/surf.m scripts/plot/draw/surfl.m
diffstat 16 files changed, 20 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- 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
 
--- 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;
--- 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
 
--- 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);
--- 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
 
--- 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{:});
--- 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],
--- 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));
--- 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
--- 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
--- 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
 
--- 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
 
--- 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
 
--- 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
 
--- 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
--- 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