# HG changeset patch # User jwe # Date 1191617539 0 # Node ID 9ac23c7f1c37e9eac627ddfd0207c93f333aa78f # Parent b559b4bcf51f6d2fb142348e3aaa1cb7f3811818 [project @ 2007-10-05 20:52:19 by jwe] diff -r b559b4bcf51f -r 9ac23c7f1c37 scripts/ChangeLog --- a/scripts/ChangeLog Fri Oct 05 19:35:22 2007 +0000 +++ b/scripts/ChangeLog Fri Oct 05 20:52:19 2007 +0000 @@ -1,3 +1,8 @@ +2007-10-05 John W. Eaton + + * plot/__next_line_color__.m: Get color_rotation from axes + colororder property. + 2007-10-03 John W. Eaton * miscellaneous/dir.m: Handle symbolic links in compatible way. diff -r b559b4bcf51f -r 9ac23c7f1c37 scripts/plot/__next_line_color__.m --- a/scripts/plot/__next_line_color__.m Fri Oct 05 19:35:22 2007 +0000 +++ b/scripts/plot/__next_line_color__.m Fri Oct 05 20:52:19 2007 +0000 @@ -25,25 +25,22 @@ function rgb = __next_line_color__ (reset) - persistent color_rotation = [ 0, 0, 1; - 0, 0.5, 0; - 1, 0, 0; - 0, 0.75, 0.75; - 0.75, 0, 0.75; - 0.75, 0.75, 0; - 0.25, 0.25, 0.25]; - - persistent num_colors = rows (color_rotation); - persistent color_index = 1; + persistent color_rotation; + persistent num_colors; + persistent color_index; if (nargin < 2) if (nargin == 1 && reset) + color_rotation = get (gca (), "colororder"); + num_colors = rows (color_rotation); color_index = 1; - else + elseif (! isempty (color_rotation)) rgb = color_rotation(color_index,:); if (++color_index > num_colors) color_index = 1; endif + else + error ("__next_line_color__: color_rotation not initialized"); endif else print_usage (); diff -r b559b4bcf51f -r 9ac23c7f1c37 src/ChangeLog --- a/src/ChangeLog Fri Oct 05 19:35:22 2007 +0000 +++ b/src/ChangeLog Fri Oct 05 20:52:19 2007 +0000 @@ -1,5 +1,11 @@ 2007-10-05 John W. Eaton + * graphics.h.in (axes::properties): New property, colororder. + * graphics.cc (default_colororder): New function. + (axes::properties::properties, axes::properties::get, + axes::properties::set_defaults, + axes::properties::factory_defaults, ): Handle colororder. + * mappers.cc (xzlgamma): New static function. (install_mapper_functions): Pass xzlgamma for c_c_map for lgamma mapper. Pass 1 for can_ret_cmplx_for_real and set hi to diff -r b559b4bcf51f -r 9ac23c7f1c37 src/graphics.cc --- a/src/graphics.cc Fri Oct 05 19:35:22 2007 +0000 +++ b/src/graphics.cc Fri Oct 05 20:52:19 2007 +0000 @@ -1001,6 +1001,33 @@ // --------------------------------------------------------------------- +static Matrix +default_colororder (void) +{ + Matrix retval (7, 3, 0.0); + + retval(0,2) = 1.0; + + retval(1,1) = 0.5; + + retval(2,0) = 1.0; + + retval(3,1) = 0.75; + retval(3,2) = 0.75; + + retval(4,0) = 0.75; + retval(4,2) = 0.75; + + retval(5,0) = 0.75; + retval(5,1) = 0.75; + + retval(6,0) = 0.25; + retval(6,1) = 0.25; + retval(6,2) = 0.25; + + return retval; +} + axes::properties::properties (const graphics_handle& mh, const graphics_handle& p) : base_properties (go_name, mh, p), @@ -1010,6 +1037,7 @@ key ("off"), keybox ("off"), keypos (1), + colororder (default_colororder ()), dataaspectratio (Matrix (1, 3, 1.0)), dataaspectratiomode ("auto"), xlim (), @@ -1163,6 +1191,8 @@ set_keybox (val); else if (name.compare ("keypos")) set_keypos (val); + else if (name.compare ("colororder")) + set_colororder (val); else if (name.compare ("dataaspectratio")) set_dataaspectratio (val); else if (name.compare ("dataaspectratiomode")) @@ -1269,6 +1299,7 @@ key = "off"; keybox = "off"; keypos = 1; + colororder = default_colororder (); dataaspectratio = Matrix (1, 3, 1.0); dataaspectratiomode = "auto"; @@ -1392,6 +1423,7 @@ m.assign ("key", key); m.assign ("keybox", keybox); m.assign ("keypos", keypos); + m.assign ("colororder", colororder); m.assign ("dataaspectratio", dataaspectratio); m.assign ("dataaspectratiomode", dataaspectratiomode); m.assign ("xlim", xlim); @@ -1464,6 +1496,8 @@ retval = keybox; else if (name.compare ("keypos")) retval = keypos; + else if (name.compare ("colororder")) + retval = colororder; else if (name.compare ("dataaspectratio")) retval = dataaspectratio; else if (name.compare ("dataaspectratiomode")) @@ -1593,6 +1627,7 @@ m["key"] = "off"; m["keybox"] = "off"; m["keypos"] = 1; + m["colororder"] = default_colororder (); m["dataaspectratio"] = Matrix (1, 3, 1.0); m["dataaspectratiomode"] = "auto"; diff -r b559b4bcf51f -r 9ac23c7f1c37 src/graphics.h.in --- a/src/graphics.h.in Fri Oct 05 19:35:22 2007 +0000 +++ b/src/graphics.h.in Fri Oct 05 20:52:19 2007 +0000 @@ -1136,6 +1136,7 @@ octave_value key octave_value keybox octave_value keypos + octave_value colororder octave_value dataaspectratio m octave_value dataaspectratiomode octave_value xlim m