annotate scripts/plot/private/__next_line_color__.m @ 14138:72c96de7a403 stable

maint: update copyright notices for 2012
author John W. Eaton <jwe@octave.org>
date Mon, 02 Jan 2012 14:25:41 -0500
parents 6f91ca83d2be
children 78a2f43bbc69
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
14138
72c96de7a403 maint: update copyright notices for 2012
John W. Eaton <jwe@octave.org>
parents: 12793
diff changeset
1 ## Copyright (C) 2007-2012 John W. Eaton
6264
cc2bee854d23 [project @ 2007-02-01 10:00:05 by jwe]
jwe
parents:
diff changeset
2 ##
cc2bee854d23 [project @ 2007-02-01 10:00:05 by jwe]
jwe
parents:
diff changeset
3 ## This file is part of Octave.
cc2bee854d23 [project @ 2007-02-01 10:00:05 by jwe]
jwe
parents:
diff changeset
4 ##
cc2bee854d23 [project @ 2007-02-01 10:00:05 by jwe]
jwe
parents:
diff changeset
5 ## Octave is free software; you can redistribute it and/or modify it
cc2bee854d23 [project @ 2007-02-01 10:00:05 by jwe]
jwe
parents:
diff changeset
6 ## under the terms of the GNU General Public License as published by
7016
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6962
diff changeset
7 ## the Free Software Foundation; either version 3 of the License, or (at
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6962
diff changeset
8 ## your option) any later version.
6264
cc2bee854d23 [project @ 2007-02-01 10:00:05 by jwe]
jwe
parents:
diff changeset
9 ##
cc2bee854d23 [project @ 2007-02-01 10:00:05 by jwe]
jwe
parents:
diff changeset
10 ## Octave is distributed in the hope that it will be useful, but
cc2bee854d23 [project @ 2007-02-01 10:00:05 by jwe]
jwe
parents:
diff changeset
11 ## WITHOUT ANY WARRANTY; without even the implied warranty of
cc2bee854d23 [project @ 2007-02-01 10:00:05 by jwe]
jwe
parents:
diff changeset
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
cc2bee854d23 [project @ 2007-02-01 10:00:05 by jwe]
jwe
parents:
diff changeset
13 ## General Public License for more details.
cc2bee854d23 [project @ 2007-02-01 10:00:05 by jwe]
jwe
parents:
diff changeset
14 ##
cc2bee854d23 [project @ 2007-02-01 10:00:05 by jwe]
jwe
parents:
diff changeset
15 ## You should have received a copy of the GNU General Public License
7016
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6962
diff changeset
16 ## along with Octave; see the file COPYING. If not, see
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6962
diff changeset
17 ## <http://www.gnu.org/licenses/>.
6264
cc2bee854d23 [project @ 2007-02-01 10:00:05 by jwe]
jwe
parents:
diff changeset
18
8812
7d48766c21a5 use consistent format for doc strings of internal functions
John W. Eaton <jwe@octave.org>
parents: 7016
diff changeset
19 ## -*- texinfo -*-
7d48766c21a5 use consistent format for doc strings of internal functions
John W. Eaton <jwe@octave.org>
parents: 7016
diff changeset
20 ## @deftypefn {Function File} {@var{rgb} =} __next_line_color__ (@var{reset})
6895
76e3d985ae56 [project @ 2007-09-13 18:22:38 by jwe]
jwe
parents: 6265
diff changeset
21 ## Undocumented internal function.
8812
7d48766c21a5 use consistent format for doc strings of internal functions
John W. Eaton <jwe@octave.org>
parents: 7016
diff changeset
22 ## @end deftypefn
6895
76e3d985ae56 [project @ 2007-09-13 18:22:38 by jwe]
jwe
parents: 6265
diff changeset
23
6264
cc2bee854d23 [project @ 2007-02-01 10:00:05 by jwe]
jwe
parents:
diff changeset
24 ## Return the next line color in the rotation.
cc2bee854d23 [project @ 2007-02-01 10:00:05 by jwe]
jwe
parents:
diff changeset
25
cc2bee854d23 [project @ 2007-02-01 10:00:05 by jwe]
jwe
parents:
diff changeset
26 ## Author: jwe
cc2bee854d23 [project @ 2007-02-01 10:00:05 by jwe]
jwe
parents:
diff changeset
27
cc2bee854d23 [project @ 2007-02-01 10:00:05 by jwe]
jwe
parents:
diff changeset
28 function rgb = __next_line_color__ (reset)
cc2bee854d23 [project @ 2007-02-01 10:00:05 by jwe]
jwe
parents:
diff changeset
29
6962
9ac23c7f1c37 [project @ 2007-10-05 20:52:19 by jwe]
jwe
parents: 6895
diff changeset
30 persistent color_rotation;
9ac23c7f1c37 [project @ 2007-10-05 20:52:19 by jwe]
jwe
parents: 6895
diff changeset
31 persistent num_colors;
9ac23c7f1c37 [project @ 2007-10-05 20:52:19 by jwe]
jwe
parents: 6895
diff changeset
32 persistent color_index;
6264
cc2bee854d23 [project @ 2007-02-01 10:00:05 by jwe]
jwe
parents:
diff changeset
33
cc2bee854d23 [project @ 2007-02-01 10:00:05 by jwe]
jwe
parents:
diff changeset
34 if (nargin < 2)
11587
c792872f8942 all script files: untabify and strip trailing whitespace
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
35 if (nargin == 1)
10770
84c35a483d1f Support 'hold all' (Feature Request #30336)
David Bateman <dbateman@free.fr>
parents: 10549
diff changeset
36 if (reset || isempty (color_rotation))
84c35a483d1f Support 'hold all' (Feature Request #30336)
David Bateman <dbateman@free.fr>
parents: 10549
diff changeset
37 color_rotation = get (gca (), "colororder");
84c35a483d1f Support 'hold all' (Feature Request #30336)
David Bateman <dbateman@free.fr>
parents: 10549
diff changeset
38 num_colors = rows (color_rotation);
84c35a483d1f Support 'hold all' (Feature Request #30336)
David Bateman <dbateman@free.fr>
parents: 10549
diff changeset
39 color_index = 1;
84c35a483d1f Support 'hold all' (Feature Request #30336)
David Bateman <dbateman@free.fr>
parents: 10549
diff changeset
40 endif
6962
9ac23c7f1c37 [project @ 2007-10-05 20:52:19 by jwe]
jwe
parents: 6895
diff changeset
41 elseif (! isempty (color_rotation))
6265
598c2be12ab9 [project @ 2007-02-01 10:09:53 by jwe]
jwe
parents: 6264
diff changeset
42 rgb = color_rotation(color_index,:);
6264
cc2bee854d23 [project @ 2007-02-01 10:00:05 by jwe]
jwe
parents:
diff changeset
43 if (++color_index > num_colors)
10549
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 10135
diff changeset
44 color_index = 1;
10135
4516a0c97ced Handle linestyleorder. Remove @ markers. Treat edgecolor, markeredgecolor and markerfacecolor correctly in scatter.
David Bateman <dbateman@free.fr>
parents: 8920
diff changeset
45 __next_line_style__ ("incr");
6264
cc2bee854d23 [project @ 2007-02-01 10:00:05 by jwe]
jwe
parents:
diff changeset
46 endif
6962
9ac23c7f1c37 [project @ 2007-10-05 20:52:19 by jwe]
jwe
parents: 6895
diff changeset
47 else
9ac23c7f1c37 [project @ 2007-10-05 20:52:19 by jwe]
jwe
parents: 6895
diff changeset
48 error ("__next_line_color__: color_rotation not initialized");
6264
cc2bee854d23 [project @ 2007-02-01 10:00:05 by jwe]
jwe
parents:
diff changeset
49 endif
cc2bee854d23 [project @ 2007-02-01 10:00:05 by jwe]
jwe
parents:
diff changeset
50 else
cc2bee854d23 [project @ 2007-02-01 10:00:05 by jwe]
jwe
parents:
diff changeset
51 print_usage ();
cc2bee854d23 [project @ 2007-02-01 10:00:05 by jwe]
jwe
parents:
diff changeset
52 endif
cc2bee854d23 [project @ 2007-02-01 10:00:05 by jwe]
jwe
parents:
diff changeset
53
cc2bee854d23 [project @ 2007-02-01 10:00:05 by jwe]
jwe
parents:
diff changeset
54 endfunction