annotate scripts/plot/private/__next_line_color__.m @ 17436:47269b03a946

__next_line_color__.m: Remove use of CamelCase. * scripts/plot/private/__next_line_color__.m: Remove use of CamelCase.
author Rik <rik@octave.org>
date Wed, 18 Sep 2013 17:11:32 -0700
parents abf384f5d243
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
16943
0dab17e69a55 Implement line color and style rotation across multiple axes (bug #39344).
Carl Osterwisch <costerwisch@costerwisch-lt1>
parents: 16942
diff changeset
1 ## Copyright (C) 2013 Carl Osterwisch
14138
72c96de7a403 maint: update copyright notices for 2012
John W. Eaton <jwe@octave.org>
parents: 12793
diff changeset
2 ## Copyright (C) 2007-2012 John W. Eaton
6264
cc2bee854d23 [project @ 2007-02-01 10:00:05 by jwe]
jwe
parents:
diff changeset
3 ##
cc2bee854d23 [project @ 2007-02-01 10:00:05 by jwe]
jwe
parents:
diff changeset
4 ## This file is part of Octave.
cc2bee854d23 [project @ 2007-02-01 10:00:05 by jwe]
jwe
parents:
diff changeset
5 ##
cc2bee854d23 [project @ 2007-02-01 10:00:05 by jwe]
jwe
parents:
diff changeset
6 ## 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
7 ## 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
8 ## 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
9 ## your option) any later version.
6264
cc2bee854d23 [project @ 2007-02-01 10:00:05 by jwe]
jwe
parents:
diff changeset
10 ##
cc2bee854d23 [project @ 2007-02-01 10:00:05 by jwe]
jwe
parents:
diff changeset
11 ## 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
12 ## WITHOUT ANY WARRANTY; without even the implied warranty of
cc2bee854d23 [project @ 2007-02-01 10:00:05 by jwe]
jwe
parents:
diff changeset
13 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
cc2bee854d23 [project @ 2007-02-01 10:00:05 by jwe]
jwe
parents:
diff changeset
14 ## General Public License for more details.
cc2bee854d23 [project @ 2007-02-01 10:00:05 by jwe]
jwe
parents:
diff changeset
15 ##
cc2bee854d23 [project @ 2007-02-01 10:00:05 by jwe]
jwe
parents:
diff changeset
16 ## 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
17 ## 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
18 ## <http://www.gnu.org/licenses/>.
6264
cc2bee854d23 [project @ 2007-02-01 10:00:05 by jwe]
jwe
parents:
diff changeset
19
8812
7d48766c21a5 use consistent format for doc strings of internal functions
John W. Eaton <jwe@octave.org>
parents: 7016
diff changeset
20 ## -*- texinfo -*-
7d48766c21a5 use consistent format for doc strings of internal functions
John W. Eaton <jwe@octave.org>
parents: 7016
diff changeset
21 ## @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
22 ## Undocumented internal function.
8812
7d48766c21a5 use consistent format for doc strings of internal functions
John W. Eaton <jwe@octave.org>
parents: 7016
diff changeset
23 ## @end deftypefn
6895
76e3d985ae56 [project @ 2007-09-13 18:22:38 by jwe]
jwe
parents: 6265
diff changeset
24
6264
cc2bee854d23 [project @ 2007-02-01 10:00:05 by jwe]
jwe
parents:
diff changeset
25 ## Return the next line color in the rotation.
cc2bee854d23 [project @ 2007-02-01 10:00:05 by jwe]
jwe
parents:
diff changeset
26
16942
78a2f43bbc69 Implemented line color and style rotation across multiple axes (bug #39344).
costerwisch@costerwisch-lt1
parents: 14138
diff changeset
27 ## Author: Carl Osterwisch
16943
0dab17e69a55 Implement line color and style rotation across multiple axes (bug #39344).
Carl Osterwisch <costerwisch@costerwisch-lt1>
parents: 16942
diff changeset
28 ## Author: jwe
6264
cc2bee854d23 [project @ 2007-02-01 10:00:05 by jwe]
jwe
parents:
diff changeset
29
cc2bee854d23 [project @ 2007-02-01 10:00:05 by jwe]
jwe
parents:
diff changeset
30 function rgb = __next_line_color__ (reset)
cc2bee854d23 [project @ 2007-02-01 10:00:05 by jwe]
jwe
parents:
diff changeset
31
16942
78a2f43bbc69 Implemented line color and style rotation across multiple axes (bug #39344).
costerwisch@costerwisch-lt1
parents: 14138
diff changeset
32 persistent reset_colors = true;
6264
cc2bee854d23 [project @ 2007-02-01 10:00:05 by jwe]
jwe
parents:
diff changeset
33
16943
0dab17e69a55 Implement line color and style rotation across multiple axes (bug #39344).
Carl Osterwisch <costerwisch@costerwisch-lt1>
parents: 16942
diff changeset
34 if (nargin == 1)
0dab17e69a55 Implement line color and style rotation across multiple axes (bug #39344).
Carl Osterwisch <costerwisch@costerwisch-lt1>
parents: 16942
diff changeset
35 ## Indicates whether the next call will increment or not
0dab17e69a55 Implement line color and style rotation across multiple axes (bug #39344).
Carl Osterwisch <costerwisch@costerwisch-lt1>
parents: 16942
diff changeset
36 reset_colors = reset;
0dab17e69a55 Implement line color and style rotation across multiple axes (bug #39344).
Carl Osterwisch <costerwisch@costerwisch-lt1>
parents: 16942
diff changeset
37 else
0dab17e69a55 Implement line color and style rotation across multiple axes (bug #39344).
Carl Osterwisch <costerwisch@costerwisch-lt1>
parents: 16942
diff changeset
38 ## Find and return the next line color
0dab17e69a55 Implement line color and style rotation across multiple axes (bug #39344).
Carl Osterwisch <costerwisch@costerwisch-lt1>
parents: 16942
diff changeset
39 ca = gca ();
17436
47269b03a946 __next_line_color__.m: Remove use of CamelCase.
Rik <rik@octave.org>
parents: 17176
diff changeset
40 colororder = get (ca, "colororder");
16943
0dab17e69a55 Implement line color and style rotation across multiple axes (bug #39344).
Carl Osterwisch <costerwisch@costerwisch-lt1>
parents: 16942
diff changeset
41 if (reset_colors)
0dab17e69a55 Implement line color and style rotation across multiple axes (bug #39344).
Carl Osterwisch <costerwisch@costerwisch-lt1>
parents: 16942
diff changeset
42 color_index = 1;
16959
22ec459cf7ba Correction to allow multi-line plots to have multiple colors (bug #16955).
Carl Osterwisch <costerwisch@generalcompression.com>
parents: 16943
diff changeset
43 reset_colors = false;
16943
0dab17e69a55 Implement line color and style rotation across multiple axes (bug #39344).
Carl Osterwisch <costerwisch@costerwisch-lt1>
parents: 16942
diff changeset
44 else
0dab17e69a55 Implement line color and style rotation across multiple axes (bug #39344).
Carl Osterwisch <costerwisch@costerwisch-lt1>
parents: 16942
diff changeset
45 ## Executed when "hold all" is active
17436
47269b03a946 __next_line_color__.m: Remove use of CamelCase.
Rik <rik@octave.org>
parents: 17176
diff changeset
46 n_kids = length (get (ca, "children"));
47269b03a946 __next_line_color__.m: Remove use of CamelCase.
Rik <rik@octave.org>
parents: 17176
diff changeset
47 n_colors = rows (colororder);
47269b03a946 __next_line_color__.m: Remove use of CamelCase.
Rik <rik@octave.org>
parents: 17176
diff changeset
48 color_index = mod (n_kids, n_colors) + 1;
16943
0dab17e69a55 Implement line color and style rotation across multiple axes (bug #39344).
Carl Osterwisch <costerwisch@costerwisch-lt1>
parents: 16942
diff changeset
49 endif
17436
47269b03a946 __next_line_color__.m: Remove use of CamelCase.
Rik <rik@octave.org>
parents: 17176
diff changeset
50 rgb = colororder(color_index,:);
16943
0dab17e69a55 Implement line color and style rotation across multiple axes (bug #39344).
Carl Osterwisch <costerwisch@costerwisch-lt1>
parents: 16942
diff changeset
51 endif
0dab17e69a55 Implement line color and style rotation across multiple axes (bug #39344).
Carl Osterwisch <costerwisch@costerwisch-lt1>
parents: 16942
diff changeset
52
6264
cc2bee854d23 [project @ 2007-02-01 10:00:05 by jwe]
jwe
parents:
diff changeset
53 endfunction
16943
0dab17e69a55 Implement line color and style rotation across multiple axes (bug #39344).
Carl Osterwisch <costerwisch@costerwisch-lt1>
parents: 16942
diff changeset
54