7017
|
1 ## Copyright (C) 2005, 2006, 2007 John W. Eaton |
6257
|
2 ## |
|
3 ## This file is part of Octave. |
|
4 ## |
|
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 |
7016
|
7 ## the Free Software Foundation; either version 3 of the License, or (at |
|
8 ## your option) any later version. |
6257
|
9 ## |
|
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. |
|
14 ## |
|
15 ## You should have received a copy of the GNU General Public License |
7016
|
16 ## along with Octave; see the file COPYING. If not, see |
|
17 ## <http://www.gnu.org/licenses/>. |
6257
|
18 |
|
19 ## -*- texinfo -*- |
|
20 ## @deftypefn {Function File} {} newplot () |
6895
|
21 ## Prepare graphics engine to produce a new plot. This function should |
|
22 ## be called at the beginning of all high-level plotting functions. |
6257
|
23 ## @end deftypefn |
|
24 |
|
25 function newplot () |
|
26 |
|
27 if (nargin == 0) |
6394
|
28 __next_line_color__ (true); |
6257
|
29 cf = gcf (); |
|
30 fnp = get (cf, "nextplot"); |
|
31 switch (fnp) |
6314
|
32 ## FIXME -- probably we should do more than validate the nextplot |
|
33 ## property value... |
6257
|
34 case "new" |
|
35 case "add" |
|
36 case "replacechildren" |
|
37 case "replace" |
|
38 otherwise |
|
39 error ("newplot: unrecognized nextplot property for current figure"); |
|
40 endswitch |
|
41 ca = gca (); |
|
42 anp = get (ca, "nextplot"); |
|
43 switch (anp) |
|
44 case "add" |
|
45 case "replacechildren" |
|
46 case "replace" |
6405
|
47 __go_axes_init__ (ca, "replace"); |
6419
|
48 __request_drawnow__ (); |
6257
|
49 otherwise |
|
50 error ("newplot: unrecognized nextplot property for current axes"); |
|
51 endswitch |
|
52 else |
|
53 print_usage (); |
|
54 endif |
|
55 |
|
56 endfunction |