annotate scripts/plot/cla.m @ 13141:e81ddf9cacd5

maint: untabify and remove trailing whitespace from source files * bicg.m, gmres.m, pkg.m: Untabify and remove trailing whitespace. * libcruft/Makefile.am, libcruft/blas-xtra/cdotc3.f, libcruft/blas-xtra/cmatm3.f, libcruft/blas-xtra/ddot3.f, libcruft/blas-xtra/dmatm3.f, libcruft/blas-xtra/sdot3.f, libcruft/blas-xtra/smatm3.f, libcruft/blas-xtra/zdotc3.f, libcruft/blas-xtra/zmatm3.f, libcruft/lapack-xtra/crsf2csf.f, libcruft/lapack-xtra/zrsf2csf.f, liboctave/Array.cc, liboctave/DASPK-opts.in, liboctave/DASRT-opts.in, liboctave/DASSL-opts.in, liboctave/LSODE-opts.in, liboctave/Makefile.a,mliboctave/Quad-opts.in, liboctave/Sparse-perm-op-defs.h, scripts/Makefile.a,mscripts/deprecated/glpkmex.m, scripts/general/blkdiag.m, scripts/general/interp1.m, scripts/general/profshow.m, scripts/general/quadl.m, scripts/general/triplequad.m, scripts/help/__makeinfo__.m, scripts/io/strread.m, scripts/io/textread.m, scripts/io/textscan.m, scripts/linear-algebra/rank.m, scripts/miscellaneous/gzip.m, scripts/miscellaneous/private/__xzip__.m, scripts/miscellaneous/tempdir.m, scripts/miscellaneous/unpack.m, scripts/pkg/pkg.m, scripts/plot/allchild.m, scripts/plot/ancestor.m, scripts/plot/cla.m, scripts/plot/clf.m, scripts/plot/findall.m, scripts/plot/findobj.m, scripts/plot/gca.m, scripts/plot/gcf.m, scripts/plot/hggroup.m, scripts/plot/isfigure.m, scripts/plot/ishghandle.m, scripts/plot/legend.m, scripts/plot/line.m, scripts/plot/loglog.m, scripts/plot/patch.m, scripts/plot/print.m, scripts/plot/private/__quiver__.m, scripts/plot/private/__scatter__.m, scripts/plot/rectangle.m, scripts/plot/semilogx.m, scripts/plot/semilogy.m, scripts/plot/surface.m, scripts/plot/text.m, scripts/plot/title.m, scripts/plot/trisurf.m, scripts/plot/view.m, scripts/plot/whitebg.m, scripts/plot/xlabel.m, scripts/plot/xlim.m, scripts/plot/ylabel.m, scripts/plot/ylim.m, scripts/plot/zlabel.m, scripts/plot/zlim.m, scripts/polynomial/mkpp.m, scripts/polynomial/polygcd.m, scripts/polynomial/ppint.m, scripts/polynomial/ppjumps.m, scripts/polynomial/ppval.m, scripts/set/setxor.m, scripts/sparse/bicgstab.m, scripts/sparse/cgs.m, scripts/sparse/spconvert.m, scripts/specfun/nthroot.m, scripts/strings/strmatch.m, scripts/strings/untabify.m, scripts/testfun/demo.m, scripts/testfun/example.m, src/DLD-FUNCTIONS/filter.cc, src/DLD-FUNCTIONS/mgorth.cc, src/DLD-FUNCTIONS/quadcc.cc, src/DLD-FUNCTIONS/str2double.cc, src/Makefile.a,msrc/gl-render.cc, src/gl2ps-renderer.cc, src/graphics.cc, src/octave-config.cc.in, src/octave-config.in, src/ov-class.h, src/ov-fcn.h, src/profiler.cc, src/profiler.h, src/pt-binop.cc, src/pt-unop.cc, src/symtab.cc, src/txt-eng-ft.cc: Remove trailing whitespace.
author John W. Eaton <jwe@octave.org>
date Thu, 15 Sep 2011 12:51:10 -0400
parents 2ea1658ad049
children 72c96de7a403
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
11523
fd0a3ac60b0e update copyright notices
John W. Eaton <jwe@octave.org>
parents: 11104
diff changeset
1 ## Copyright (C) 2008-2011 Ben Abbott
11587
c792872f8942 all script files: untabify and strip trailing whitespace
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
2 ##
11104
2c356a35d7f5 fix copyright notices
John W. Eaton <jwe@octave.org>
parents: 10793
diff changeset
3 ## This file is part of Octave.
2c356a35d7f5 fix copyright notices
John W. Eaton <jwe@octave.org>
parents: 10793
diff changeset
4 ##
2c356a35d7f5 fix copyright notices
John W. Eaton <jwe@octave.org>
parents: 10793
diff changeset
5 ## Octave is free software; you can redistribute it and/or modify it
2c356a35d7f5 fix copyright notices
John W. Eaton <jwe@octave.org>
parents: 10793
diff changeset
6 ## under the terms of the GNU General Public License as published by
2c356a35d7f5 fix copyright notices
John W. Eaton <jwe@octave.org>
parents: 10793
diff changeset
7 ## the Free Software Foundation; either version 3 of the License, or (at
2c356a35d7f5 fix copyright notices
John W. Eaton <jwe@octave.org>
parents: 10793
diff changeset
8 ## your option) any later version.
2c356a35d7f5 fix copyright notices
John W. Eaton <jwe@octave.org>
parents: 10793
diff changeset
9 ##
2c356a35d7f5 fix copyright notices
John W. Eaton <jwe@octave.org>
parents: 10793
diff changeset
10 ## Octave is distributed in the hope that it will be useful, but
2c356a35d7f5 fix copyright notices
John W. Eaton <jwe@octave.org>
parents: 10793
diff changeset
11 ## WITHOUT ANY WARRANTY; without even the implied warranty of
2c356a35d7f5 fix copyright notices
John W. Eaton <jwe@octave.org>
parents: 10793
diff changeset
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
2c356a35d7f5 fix copyright notices
John W. Eaton <jwe@octave.org>
parents: 10793
diff changeset
13 ## General Public License for more details.
2c356a35d7f5 fix copyright notices
John W. Eaton <jwe@octave.org>
parents: 10793
diff changeset
14 ##
8199
ec1b4cd5fbbb cla.m: Add matlab function cla().
Ben Abbott <bpabbott@mac.com>
parents:
diff changeset
15 ## You should have received a copy of the GNU General Public License
ec1b4cd5fbbb cla.m: Add matlab function cla().
Ben Abbott <bpabbott@mac.com>
parents:
diff changeset
16 ## along with Octave; see the file COPYING. If not, see
ec1b4cd5fbbb cla.m: Add matlab function cla().
Ben Abbott <bpabbott@mac.com>
parents:
diff changeset
17 ## <http://www.gnu.org/licenses/>.
ec1b4cd5fbbb cla.m: Add matlab function cla().
Ben Abbott <bpabbott@mac.com>
parents:
diff changeset
18
ec1b4cd5fbbb cla.m: Add matlab function cla().
Ben Abbott <bpabbott@mac.com>
parents:
diff changeset
19 ## -*- texinfo -*-
10793
be55736a0783 Grammarcheck the documentation from m-files.
Rik <octave@nomad.inbox5.com>
parents: 10549
diff changeset
20 ## @deftypefn {Function File} {} cla ()
8199
ec1b4cd5fbbb cla.m: Add matlab function cla().
Ben Abbott <bpabbott@mac.com>
parents:
diff changeset
21 ## @deftypefnx {Function File} {} cla ("reset")
ec1b4cd5fbbb cla.m: Add matlab function cla().
Ben Abbott <bpabbott@mac.com>
parents:
diff changeset
22 ## @deftypefnx {Function File} {} cla (@var{hax})
ec1b4cd5fbbb cla.m: Add matlab function cla().
Ben Abbott <bpabbott@mac.com>
parents:
diff changeset
23 ## @deftypefnx {Function File} {} cla (@var{hax}, "reset")
ec1b4cd5fbbb cla.m: Add matlab function cla().
Ben Abbott <bpabbott@mac.com>
parents:
diff changeset
24 ## Delete the children of the current axes with visible handles.
ec1b4cd5fbbb cla.m: Add matlab function cla().
Ben Abbott <bpabbott@mac.com>
parents:
diff changeset
25 ## If @var{hax} is specified and is an axes object handle, operate on it
ec1b4cd5fbbb cla.m: Add matlab function cla().
Ben Abbott <bpabbott@mac.com>
parents:
diff changeset
26 ## instead of the current axes. If the optional argument @code{"reset"}
ec1b4cd5fbbb cla.m: Add matlab function cla().
Ben Abbott <bpabbott@mac.com>
parents:
diff changeset
27 ## is specified, also delete the children with hidden handles.
ec1b4cd5fbbb cla.m: Add matlab function cla().
Ben Abbott <bpabbott@mac.com>
parents:
diff changeset
28 ## @seealso{clf}
ec1b4cd5fbbb cla.m: Add matlab function cla().
Ben Abbott <bpabbott@mac.com>
parents:
diff changeset
29 ## @end deftypefn
ec1b4cd5fbbb cla.m: Add matlab function cla().
Ben Abbott <bpabbott@mac.com>
parents:
diff changeset
30
ec1b4cd5fbbb cla.m: Add matlab function cla().
Ben Abbott <bpabbott@mac.com>
parents:
diff changeset
31 ## Author: Ben Abbott <bpabbott@mac.com>
ec1b4cd5fbbb cla.m: Add matlab function cla().
Ben Abbott <bpabbott@mac.com>
parents:
diff changeset
32 ## Created: 2008-10-03
ec1b4cd5fbbb cla.m: Add matlab function cla().
Ben Abbott <bpabbott@mac.com>
parents:
diff changeset
33
ec1b4cd5fbbb cla.m: Add matlab function cla().
Ben Abbott <bpabbott@mac.com>
parents:
diff changeset
34 function cla (varargin)
ec1b4cd5fbbb cla.m: Add matlab function cla().
Ben Abbott <bpabbott@mac.com>
parents:
diff changeset
35
ec1b4cd5fbbb cla.m: Add matlab function cla().
Ben Abbott <bpabbott@mac.com>
parents:
diff changeset
36 if (nargin > 2)
ec1b4cd5fbbb cla.m: Add matlab function cla().
Ben Abbott <bpabbott@mac.com>
parents:
diff changeset
37 print_usage ();
ec1b4cd5fbbb cla.m: Add matlab function cla().
Ben Abbott <bpabbott@mac.com>
parents:
diff changeset
38 elseif (nargin > 1)
ec1b4cd5fbbb cla.m: Add matlab function cla().
Ben Abbott <bpabbott@mac.com>
parents:
diff changeset
39 if (ishandle (varargin{1})
10549
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 8920
diff changeset
40 && strcmp (get (varargin{1}, "type"), "axes")
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 8920
diff changeset
41 && ischar (varargin{2}) && strcmpi (varargin{2}, "reset"))
8199
ec1b4cd5fbbb cla.m: Add matlab function cla().
Ben Abbott <bpabbott@mac.com>
parents:
diff changeset
42 oldhax = gca;
ec1b4cd5fbbb cla.m: Add matlab function cla().
Ben Abbott <bpabbott@mac.com>
parents:
diff changeset
43 hax = varargin{1};
ec1b4cd5fbbb cla.m: Add matlab function cla().
Ben Abbott <bpabbott@mac.com>
parents:
diff changeset
44 do_reset = true;
ec1b4cd5fbbb cla.m: Add matlab function cla().
Ben Abbott <bpabbott@mac.com>
parents:
diff changeset
45 else
ec1b4cd5fbbb cla.m: Add matlab function cla().
Ben Abbott <bpabbott@mac.com>
parents:
diff changeset
46 print_usage ();
ec1b4cd5fbbb cla.m: Add matlab function cla().
Ben Abbott <bpabbott@mac.com>
parents:
diff changeset
47 endif
ec1b4cd5fbbb cla.m: Add matlab function cla().
Ben Abbott <bpabbott@mac.com>
parents:
diff changeset
48 elseif (nargin == 1)
ec1b4cd5fbbb cla.m: Add matlab function cla().
Ben Abbott <bpabbott@mac.com>
parents:
diff changeset
49 if (ishandle (varargin{1})
10549
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 8920
diff changeset
50 && strcmp (get (varargin{1}, "type"), "axes"))
8199
ec1b4cd5fbbb cla.m: Add matlab function cla().
Ben Abbott <bpabbott@mac.com>
parents:
diff changeset
51 oldhax = gca;
ec1b4cd5fbbb cla.m: Add matlab function cla().
Ben Abbott <bpabbott@mac.com>
parents:
diff changeset
52 hax = varargin{1};
ec1b4cd5fbbb cla.m: Add matlab function cla().
Ben Abbott <bpabbott@mac.com>
parents:
diff changeset
53 do_reset = false;
ec1b4cd5fbbb cla.m: Add matlab function cla().
Ben Abbott <bpabbott@mac.com>
parents:
diff changeset
54 elseif (ischar (varargin{1}) && strcmpi (varargin{1}, "reset"))
ec1b4cd5fbbb cla.m: Add matlab function cla().
Ben Abbott <bpabbott@mac.com>
parents:
diff changeset
55 hax = gca;
ec1b4cd5fbbb cla.m: Add matlab function cla().
Ben Abbott <bpabbott@mac.com>
parents:
diff changeset
56 oldhax = hax;
ec1b4cd5fbbb cla.m: Add matlab function cla().
Ben Abbott <bpabbott@mac.com>
parents:
diff changeset
57 do_reset = true;
ec1b4cd5fbbb cla.m: Add matlab function cla().
Ben Abbott <bpabbott@mac.com>
parents:
diff changeset
58 else
ec1b4cd5fbbb cla.m: Add matlab function cla().
Ben Abbott <bpabbott@mac.com>
parents:
diff changeset
59 print_usage ();
ec1b4cd5fbbb cla.m: Add matlab function cla().
Ben Abbott <bpabbott@mac.com>
parents:
diff changeset
60 endif
ec1b4cd5fbbb cla.m: Add matlab function cla().
Ben Abbott <bpabbott@mac.com>
parents:
diff changeset
61 else
ec1b4cd5fbbb cla.m: Add matlab function cla().
Ben Abbott <bpabbott@mac.com>
parents:
diff changeset
62 hax = gca;
ec1b4cd5fbbb cla.m: Add matlab function cla().
Ben Abbott <bpabbott@mac.com>
parents:
diff changeset
63 oldhax = hax;
ec1b4cd5fbbb cla.m: Add matlab function cla().
Ben Abbott <bpabbott@mac.com>
parents:
diff changeset
64 do_reset = false;
8610
85c9906abfd1 use endif and endfor instead of end
John W. Eaton <jwe@octave.org>
parents: 8285
diff changeset
65 endif
8199
ec1b4cd5fbbb cla.m: Add matlab function cla().
Ben Abbott <bpabbott@mac.com>
parents:
diff changeset
66
8264
bca580bbda02 cla.m: Fix error when no children to clear.
Ben Abbott <bpabbott@mac.com>
parents: 8199
diff changeset
67 hc = get (hax, "children");
bca580bbda02 cla.m: Fix error when no children to clear.
Ben Abbott <bpabbott@mac.com>
parents: 8199
diff changeset
68
bca580bbda02 cla.m: Fix error when no children to clear.
Ben Abbott <bpabbott@mac.com>
parents: 8199
diff changeset
69 if (! do_reset && ! isempty (hc))
bca580bbda02 cla.m: Fix error when no children to clear.
Ben Abbott <bpabbott@mac.com>
parents: 8199
diff changeset
70 hc = findobj (hc, "flat", "visible", "on");
8199
ec1b4cd5fbbb cla.m: Add matlab function cla().
Ben Abbott <bpabbott@mac.com>
parents:
diff changeset
71 hc = setdiff (hc, hax);
8610
85c9906abfd1 use endif and endfor instead of end
John W. Eaton <jwe@octave.org>
parents: 8285
diff changeset
72 endif
8199
ec1b4cd5fbbb cla.m: Add matlab function cla().
Ben Abbott <bpabbott@mac.com>
parents:
diff changeset
73
8264
bca580bbda02 cla.m: Fix error when no children to clear.
Ben Abbott <bpabbott@mac.com>
parents: 8199
diff changeset
74 if (! isempty (hc))
bca580bbda02 cla.m: Fix error when no children to clear.
Ben Abbott <bpabbott@mac.com>
parents: 8199
diff changeset
75 ## Delete the children of the axis.
bca580bbda02 cla.m: Fix error when no children to clear.
Ben Abbott <bpabbott@mac.com>
parents: 8199
diff changeset
76 delete (hc);
bca580bbda02 cla.m: Fix error when no children to clear.
Ben Abbott <bpabbott@mac.com>
parents: 8199
diff changeset
77 endif
8199
ec1b4cd5fbbb cla.m: Add matlab function cla().
Ben Abbott <bpabbott@mac.com>
parents:
diff changeset
78
ec1b4cd5fbbb cla.m: Add matlab function cla().
Ben Abbott <bpabbott@mac.com>
parents:
diff changeset
79 ## FIXME: The defaults should be "reset()" below, but so far there is
ec1b4cd5fbbb cla.m: Add matlab function cla().
Ben Abbott <bpabbott@mac.com>
parents:
diff changeset
80 ## no method to determine the defaults, much less return an object's
ec1b4cd5fbbb cla.m: Add matlab function cla().
Ben Abbott <bpabbott@mac.com>
parents:
diff changeset
81 ## properties to their default values. Instead make a close
ec1b4cd5fbbb cla.m: Add matlab function cla().
Ben Abbott <bpabbott@mac.com>
parents:
diff changeset
82 ## approximation.
ec1b4cd5fbbb cla.m: Add matlab function cla().
Ben Abbott <bpabbott@mac.com>
parents:
diff changeset
83
ec1b4cd5fbbb cla.m: Add matlab function cla().
Ben Abbott <bpabbott@mac.com>
parents:
diff changeset
84 axes (hax);
11589
b0084095098e missing semicolons in script files
John W. Eaton <jwe@octave.org>
parents: 11587
diff changeset
85 axis ("auto");
8199
ec1b4cd5fbbb cla.m: Add matlab function cla().
Ben Abbott <bpabbott@mac.com>
parents:
diff changeset
86
ec1b4cd5fbbb cla.m: Add matlab function cla().
Ben Abbott <bpabbott@mac.com>
parents:
diff changeset
87 ## Set the current axis back to where it was upon entry.
ec1b4cd5fbbb cla.m: Add matlab function cla().
Ben Abbott <bpabbott@mac.com>
parents:
diff changeset
88 axes (oldhax);
ec1b4cd5fbbb cla.m: Add matlab function cla().
Ben Abbott <bpabbott@mac.com>
parents:
diff changeset
89
ec1b4cd5fbbb cla.m: Add matlab function cla().
Ben Abbott <bpabbott@mac.com>
parents:
diff changeset
90 endfunction
8264
bca580bbda02 cla.m: Fix error when no children to clear.
Ben Abbott <bpabbott@mac.com>
parents: 8199
diff changeset
91
bca580bbda02 cla.m: Fix error when no children to clear.
Ben Abbott <bpabbott@mac.com>
parents: 8199
diff changeset
92 %!test
13124
2ea1658ad049 Don't use explicit figure number for tests to avoid interference with any figures opened by user.
Kai Habel <kai.habel@gmx.de>
parents: 13111
diff changeset
93 %! hf = figure ("visible", "off");
13141
e81ddf9cacd5 maint: untabify and remove trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents: 13124
diff changeset
94 %! unwind_protect
8264
bca580bbda02 cla.m: Fix error when no children to clear.
Ben Abbott <bpabbott@mac.com>
parents: 8199
diff changeset
95 %! plot (1:10)
bca580bbda02 cla.m: Fix error when no children to clear.
Ben Abbott <bpabbott@mac.com>
parents: 8199
diff changeset
96 %! cla ()
bca580bbda02 cla.m: Fix error when no children to clear.
Ben Abbott <bpabbott@mac.com>
parents: 8199
diff changeset
97 %! kids = get (gca, "children");
bca580bbda02 cla.m: Fix error when no children to clear.
Ben Abbott <bpabbott@mac.com>
parents: 8199
diff changeset
98 %! cla ()
bca580bbda02 cla.m: Fix error when no children to clear.
Ben Abbott <bpabbott@mac.com>
parents: 8199
diff changeset
99 %! unwind_protect_cleanup
bca580bbda02 cla.m: Fix error when no children to clear.
Ben Abbott <bpabbott@mac.com>
parents: 8199
diff changeset
100 %! close (hf)
bca580bbda02 cla.m: Fix error when no children to clear.
Ben Abbott <bpabbott@mac.com>
parents: 8199
diff changeset
101 %! end_unwind_protect
bca580bbda02 cla.m: Fix error when no children to clear.
Ben Abbott <bpabbott@mac.com>
parents: 8199
diff changeset
102 %! assert (numel (kids), 0)