1 ## Copyright (C) 2010-2012 David Bateman
3 ## This file is part of Octave.
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
7 ## the Free Software Foundation; either version 3 of the License, or (at
8 ## your option) any later version.
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.
15 ## You should have received a copy of the GNU General Public License
16 ## along with Octave; see the file COPYING. If not, see
17 ## <http://www.gnu.org/licenses/>.
20 ## @deftypefn {Function File} {@var{style} =} __next_line_style__ (@var{reset})
21 ## Undocumented internal function.
24 ## Return the next line style in the rotation.
27 function [linestyle, marker] = __next_line_style__ (reset)
29 persistent style_rotation;
30 persistent num_styles;
31 persistent style_index;
35 if (ischar (reset) && strncmp (reset, "incr", 4))
36 if (isempty (style_rotation))
37 error ("__next_line_style__: style_rotation not initialized");
38 elseif (++style_index > num_styles)
41 elseif (reset || isempty (style_rotation))
42 style_rotation = get (gca (), "linestyleorder");
43 if (ischar (style_rotation))
44 style_rotation = strsplit (style_rotation, "|");
46 num_styles = length (style_rotation);
49 elseif (! isempty (style_rotation))
50 options = __pltopt__ ("__next_line_style__",
51 style_rotation (style_index));
52 linestyle = options.linestyle;
53 marker = options.marker;
55 error ("__next_line_style__: style_rotation not initialized");