1 ## Copyright (C) 2005-2012 John W. Eaton
3 ## This file is part of Octave.
5 ## Octave is free software; you can redistribute it and/or modify it
6 ## under the terms of the GNU General Public License as published by
7 ## the Free Software Foundation; either version 3 of the License, or (at
8 ## your option) any later version.
10 ## Octave is distributed in the hope that it will be useful, but
11 ## WITHOUT ANY WARRANTY; without even the implied warranty of
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 ## General Public License for more details.
15 ## You should have received a copy of the GNU General Public License
16 ## along with Octave; see the file COPYING. If not, see
17 ## <http://www.gnu.org/licenses/>.
20 ## @deftypefn {Function File} {} newplot ()
21 ## Prepare graphics engine to produce a new plot. This function is
22 ## called at the beginning of all high-level plotting functions.
23 ## It is not normally required in user programs.
30 fnp = get (cf, "nextplot");
32 ## FIXME -- probably we should do more than validate the nextplot
36 case "replacechildren"
37 delete (get (cf, "children"));
40 error ("newplot: unrecognized nextplot property for current figure");
43 anp = get (ca, "nextplot");
44 if (strcmp (get (ca, "__hold_all__"), "off"))
45 __next_line_color__ (true);
46 __next_line_style__ (true);
48 __next_line_color__ (false);
49 __next_line_style__ (false);
54 case "replacechildren"
55 delete (get (ca, "children"));
57 __go_axes_init__ (ca, "replace");
58 __request_drawnow__ ();
60 error ("newplot: unrecognized nextplot property for current axes");
69 %! hf = figure ("visible", "off");
73 %! assert (isempty (get (gca, "children")));
74 %! unwind_protect_cleanup