# HG changeset patch # User Rik # Date 1380120538 25200 # Node ID f0f4b524b6d06ae7d37cec219b650c442c3b623c # Parent 25f6e31bbce96dbea593566999cfdd1a5f34ec69 maint: Correct indentation for several plot routines. * scripts/plot/ellipsoid.m, scripts/plot/rose.m, scripts/plot/sphere.m, scripts/plot/surfnorm.m: maint: Correct indentation for several plot routines. diff --git a/scripts/plot/ellipsoid.m b/scripts/plot/ellipsoid.m --- a/scripts/plot/ellipsoid.m +++ b/scripts/plot/ellipsoid.m @@ -74,10 +74,10 @@ yy = y; zz = z; else - oldfig = []; - if (! isempty (hax)) - oldfig = get (0, "currentfigure"); - endif + oldfig = []; + if (! isempty (hax)) + oldfig = get (0, "currentfigure"); + endif unwind_protect hax = newplot (hax); diff --git a/scripts/plot/rose.m b/scripts/plot/rose.m --- a/scripts/plot/rose.m +++ b/scripts/plot/rose.m @@ -90,10 +90,10 @@ r(3:4:end, :) = nn; if (nargout < 2) - oldfig = []; - if (! isempty (hax)) - oldfig = get (0, "currentfigure"); - endif + oldfig = []; + if (! isempty (hax)) + oldfig = get (0, "currentfigure"); + endif unwind_protect hax = newplot (hax); htmp = polar (th, r); diff --git a/scripts/plot/sphere.m b/scripts/plot/sphere.m --- a/scripts/plot/sphere.m +++ b/scripts/plot/sphere.m @@ -71,10 +71,10 @@ yy = y; zz = z; else - oldfig = []; - if (! isempty (hax)) - oldfig = get (0, "currentfigure"); - endif + oldfig = []; + if (! isempty (hax)) + oldfig = get (0, "currentfigure"); + endif unwind_protect hax = newplot (hax); diff --git a/scripts/plot/surfnorm.m b/scripts/plot/surfnorm.m --- a/scripts/plot/surfnorm.m +++ b/scripts/plot/surfnorm.m @@ -114,30 +114,30 @@ nz = nz ./ len; if (nargout == 0) - oldfig = []; - if (! isempty (hax)) - oldfig = get (0, "currentfigure"); - endif - unwind_protect - hax = newplot (hax); - - surf (x, y, z, varargin{ioff:end}); - old_hold_state = get (hax, "nextplot"); - unwind_protect - set (hax, "nextplot", "add"); - plot3 ([x(:)'; x(:).' + nx(:).' ; NaN(size(x(:).'))](:), - [y(:)'; y(:).' + ny(:).' ; NaN(size(y(:).'))](:), - [z(:)'; z(:).' + nz(:).' ; NaN(size(z(:).'))](:), - varargin{ioff:end}); - unwind_protect_cleanup - set (hax, "nextplot", old_hold_state); - end_unwind_protect - - unwind_protect_cleanup - if (! isempty (oldfig)) - set (0, "currentfigure", oldfig); - endif - end_unwind_protect + oldfig = []; + if (! isempty (hax)) + oldfig = get (0, "currentfigure"); + endif + unwind_protect + hax = newplot (hax); + + surf (x, y, z, varargin{ioff:end}); + old_hold_state = get (hax, "nextplot"); + unwind_protect + set (hax, "nextplot", "add"); + plot3 ([x(:)'; x(:).' + nx(:).' ; NaN(size(x(:).'))](:), + [y(:)'; y(:).' + ny(:).' ; NaN(size(y(:).'))](:), + [z(:)'; z(:).' + nz(:).' ; NaN(size(z(:).'))](:), + varargin{ioff:end}); + unwind_protect_cleanup + set (hax, "nextplot", old_hold_state); + end_unwind_protect + + unwind_protect_cleanup + if (! isempty (oldfig)) + set (0, "currentfigure", oldfig); + endif + end_unwind_protect else Nx = nx; Ny = ny;