comparison scripts/plot/feather.m @ 17219:87ba70043bfc

Don't use ifelse in plot fcns to avoid unnecessary fcn evaluations. * scripts/plot/area.m, scripts/plot/axis.m, scripts/plot/caxis.m, scripts/plot/comet.m, scripts/plot/comet3.m, scripts/plot/compass.m, scripts/plot/contour.m, scripts/plot/contour3.m, scripts/plot/contourf.m, scripts/plot/cylinder.m, scripts/plot/ellipsoid.m, scripts/plot/errorbar.m, scripts/plot/feather.m, scripts/plot/fill.m, scripts/plot/loglog.m, scripts/plot/loglogerr.m, scripts/plot/mesh.m, scripts/plot/meshc.m, scripts/plot/meshz.m, scripts/plot/pcolor.m, scripts/plot/pie.m, scripts/plot/pie3.m, scripts/plot/plot.m, scripts/plot/plot3.m, scripts/plot/polar.m, scripts/plot/private/__bar__.m, scripts/plot/private/__ezplot__.m, scripts/plot/private/__stem__.m, scripts/plot/quiver.m, scripts/plot/quiver3.m, scripts/plot/rectangle.m, scripts/plot/ribbon.m, scripts/plot/rose.m, scripts/plot/scatter.m, scripts/plot/scatter3.m, scripts/plot/semilogx.m, scripts/plot/semilogxerr.m, scripts/plot/semilogy.m, scripts/plot/semilogyerr.m, scripts/plot/slice.m, scripts/plot/sphere.m, scripts/plot/stairs.m, scripts/plot/surf.m, scripts/plot/surfc.m, scripts/plot/surfl.m, scripts/plot/surfnorm.m, scripts/time/datetick.m: Don't use ifelse in plot fcns to avoid unnecessary fcn evaluations.
author Rik <rik@octave.org>
date Fri, 09 Aug 2013 19:26:55 -0700
parents df4c4b7708a4
children 68bcac3c043a
comparison
equal deleted inserted replaced
17218:73dd413f2c3e 17219:87ba70043bfc
96 x = [[1 : n]; xend; xtmp - v * arrowsize; xend; ... 96 x = [[1 : n]; xend; xtmp - v * arrowsize; xend; ...
97 xtmp + v * arrowsize]; 97 xtmp + v * arrowsize];
98 y = [zeros(1, n); yend; ytmp + u * arrowsize / 3; yend; ... 98 y = [zeros(1, n); yend; ytmp + u * arrowsize / 3; yend; ...
99 ytmp - u * arrowsize / 3]; 99 ytmp - u * arrowsize / 3];
100 100
101 oldfig = ifelse (isempty (hax), [], get (0, "currentfigure")); 101 oldfig = [];
102 if (isempty (hax))
103 oldfig = get (0, "currentfigure");
104 endif
102 unwind_protect 105 unwind_protect
103 hax = newplot (hax); 106 hax = newplot (hax);
104 hlist = plot (x, y, line_spec, [1, n], [0, 0], line_spec); 107 hlist = plot (x, y, line_spec, [1, n], [0, 0], line_spec);
105 unwind_protect_cleanup 108 unwind_protect_cleanup
106 if (! isempty (oldfig)) 109 if (! isempty (oldfig))