Mercurial > hg > octave-nkf
annotate scripts/plot/newplot.m @ 9672:43a07df0ed4c
document graphics structures
author | Michael D. Godfrey <godfrey@isl.stanford.edu> |
---|---|
date | Wed, 30 Sep 2009 10:18:32 -0400 |
parents | eb63fbe60fab |
children | 4516a0c97ced |
rev | line source |
---|---|
8920 | 1 ## Copyright (C) 2005, 2006, 2007, 2008 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 () | |
9672
43a07df0ed4c
document graphics structures
Michael D. Godfrey <godfrey@isl.stanford.edu>
parents:
8920
diff
changeset
|
21 ## Prepare graphics engine to produce a new plot. This function is |
43a07df0ed4c
document graphics structures
Michael D. Godfrey <godfrey@isl.stanford.edu>
parents:
8920
diff
changeset
|
22 ## called at the beginning of all high-level plotting functions. |
43a07df0ed4c
document graphics structures
Michael D. Godfrey <godfrey@isl.stanford.edu>
parents:
8920
diff
changeset
|
23 ## It is not normally required in user programs. |
6257 | 24 ## @end deftypefn |
25 | |
26 function newplot () | |
27 | |
28 if (nargin == 0) | |
6394 | 29 __next_line_color__ (true); |
6257 | 30 cf = gcf (); |
31 fnp = get (cf, "nextplot"); | |
32 switch (fnp) | |
6314 | 33 ## FIXME -- probably we should do more than validate the nextplot |
34 ## property value... | |
6257 | 35 case "new" |
36 case "add" | |
37 case "replacechildren" | |
38 case "replace" | |
39 otherwise | |
40 error ("newplot: unrecognized nextplot property for current figure"); | |
41 endswitch | |
42 ca = gca (); | |
43 anp = get (ca, "nextplot"); | |
44 switch (anp) | |
45 case "add" | |
46 case "replacechildren" | |
47 case "replace" | |
6405 | 48 __go_axes_init__ (ca, "replace"); |
6419 | 49 __request_drawnow__ (); |
6257 | 50 otherwise |
51 error ("newplot: unrecognized nextplot property for current axes"); | |
52 endswitch | |
53 else | |
54 print_usage (); | |
55 endif | |
8252
b12a2975bf7e
newplot.m: delete stray debugging code
John W. Eaton <jwe@octave.org>
parents:
8228
diff
changeset
|
56 |
6257 | 57 endfunction |