Mercurial > hg > octave-lyh
annotate scripts/plot/newplot.m @ 10510:62ebba45054e
Respect the nextplot property value of 'new' for axes and 'replacechildren' for axes and figures.
author | Ben Abbott <bpabbott@mac.com> |
---|---|
date | Mon, 12 Apr 2010 18:03:25 -0400 |
parents | 4516a0c97ced |
children | 95c3e38098bf |
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); |
10135
4516a0c97ced
Handle linestyleorder. Remove @ markers. Treat edgecolor, markeredgecolor and markerfacecolor correctly in scatter.
David Bateman <dbateman@free.fr>
parents:
9672
diff
changeset
|
30 __next_line_style__ (true); |
6257 | 31 cf = gcf (); |
32 fnp = get (cf, "nextplot"); | |
33 switch (fnp) | |
6314 | 34 ## FIXME -- probably we should do more than validate the nextplot |
35 ## property value... | |
6257 | 36 case "new" |
37 case "add" | |
38 case "replacechildren" | |
10510
62ebba45054e
Respect the nextplot property value of 'new' for axes and 'replacechildren' for axes and figures.
Ben Abbott <bpabbott@mac.com>
parents:
10135
diff
changeset
|
39 delete (get (cf, "children")) |
6257 | 40 case "replace" |
41 otherwise | |
42 error ("newplot: unrecognized nextplot property for current figure"); | |
43 endswitch | |
44 ca = gca (); | |
45 anp = get (ca, "nextplot"); | |
46 switch (anp) | |
10510
62ebba45054e
Respect the nextplot property value of 'new' for axes and 'replacechildren' for axes and figures.
Ben Abbott <bpabbott@mac.com>
parents:
10135
diff
changeset
|
47 case "new" |
6257 | 48 case "add" |
49 case "replacechildren" | |
10510
62ebba45054e
Respect the nextplot property value of 'new' for axes and 'replacechildren' for axes and figures.
Ben Abbott <bpabbott@mac.com>
parents:
10135
diff
changeset
|
50 delete (get (ca, "children")) |
6257 | 51 case "replace" |
6405 | 52 __go_axes_init__ (ca, "replace"); |
6419 | 53 __request_drawnow__ (); |
6257 | 54 otherwise |
55 error ("newplot: unrecognized nextplot property for current axes"); | |
56 endswitch | |
57 else | |
58 print_usage (); | |
59 endif | |
8252
b12a2975bf7e
newplot.m: delete stray debugging code
John W. Eaton <jwe@octave.org>
parents:
8228
diff
changeset
|
60 |
6257 | 61 endfunction |