[matplotlib-devel] [Matplotlib-users] define color cycle in matplotlibrc

2010-01-03 Thread Eric Firing
http://www.mail-archive.com/matplotlib-us...@lists.sourceforge.net/msg14772.html

The above thread includes two reasonable requests:

1) add color cycle as an rcParam

2) add a line style cycle as well

The first of these is easier to implement, although it requires a bit 
more than the patch provided.  Questions:

1) Should the the color_cycle be in the axes group?  Although it affects 
lines, it is defined only at the Axes level, and affects only lines 
drawn by plot.

Alternative: since it affects only plot, should there be a new plot 
group to make that explicit, so it would be rcParams['plot.color_cycle']?

2) It was pointed out that there is a strange connection between the 
color cycle and the lines.color rcParam.  This connection looks to me 
like a bit of legacy that can be dropped with little risk of pain in 
user land, since the default would still be to have the initial color in 
the cycle (blue) be the same as the default lines.color (blue).  The 
proposed difference is that setting lines.color would have no effect on 
the color_cycle, and vice-versa.  John, I think the present connection 
dates all the  way back to your work around svn r500 or so; please tell 
me if there is some compelling reason to keep it.  It appears to me that 
breaking the connection would make both the code and the actual mpl 
behavior simpler and less surprising, with no loss of useful functionality.

3) Would it make sense to add color_cycle to the Axes API, so that it 
can be set directly for a given axes as an alternative to going through 
the rc mechanism?  Right now it can be set via a function, but must be 
set before Axes creation; this doesn't make sense to me.  It would make 
more sense as an Axes property that could be set at any time, and would 
apply to subsequent calls to plot.

My sense is that as a matter of design strategy, whenever possible, one 
should be able to use the API, via properties, methods, or functions, to 
  locally set any options for which rcParams gives the global default 
values.

Eric


--
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
___
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] [Matplotlib-users] define color cycle in matplotlibrc

2010-01-03 Thread John Hunter
On Sun, Jan 3, 2010 at 2:39 PM, Eric Firing efir...@hawaii.edu wrote:
 1) Should the the color_cycle be in the axes group?  Although it affects
 lines, it is defined only at the Axes level, and affects only lines drawn by
 plot.

 Alternative: since it affects only plot, should there be a new plot group
 to make that explicit, so it would be rcParams['plot.color_cycle']?

I think it is better to do at the Axes level, because even if plot is
the only command to do this now, I could imagine others commands
wanting to use it (fill_between, bar?).  I have had people asking me
just for access to the list so they could use it for some purpose or
another, so having the list easily accessible is desirable.

 2) It was pointed out that there is a strange connection between the color
 cycle and the lines.color rcParam.  This connection looks to me like a bit
 of legacy that can be dropped with little risk of pain in user land, since
 the default would still be to have the initial color in the cycle (blue) be
 the same as the default lines.color (blue).  The proposed difference is that
 setting lines.color would have no effect on the color_cycle, and vice-versa.
  John, I think the present connection dates all the  way back to your work
 around svn r500 or so; please tell me if there is some compelling reason to
 keep it.  It appears to me that breaking the connection would make both the
 code and the actual mpl behavior simpler and less surprising, with no loss
 of useful functionality.

I think deprecating lines.color and making the first element of the
cycle be the default color makes the most sense.

 3) Would it make sense to add color_cycle to the Axes API, so that it can be
 set directly for a given axes as an alternative to going through the rc
 mechanism?  Right now it can be set via a function, but must be set before
 Axes creation; this doesn't make sense to me.  It would make more sense as
 an Axes property that could be set at any time, and would apply to
 subsequent calls to plot.

It might be best to make this a class level attribute, that way people
can tweak it globally or at the instance level, and have access to the
list *before* the Axes instance is created. The downside of this is it
falls outside of the usual properties pattern that people can access
via the normal introspection facilities.

The linestyles  cycle question is as you say a good bit harder, and
would best be served by having some sort of configurable color scheme,
where one could set grayscale or something like that to get default
black/white/gray colors and styles for the cycle.

JDH

--
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
___
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] [Matplotlib-users] define color cycle in matplotlibrc

2010-01-03 Thread Eric Firing

 2) It was pointed out that there is a strange connection between the color
 cycle and the lines.color rcParam.  This connection looks to me like a bit
 of legacy that can be dropped with little risk of pain in user land, since
 the default would still be to have the initial color in the cycle (blue) be
 the same as the default lines.color (blue).  The proposed difference is that
 setting lines.color would have no effect on the color_cycle, and vice-versa.
  John, I think the present connection dates all the  way back to your work
 around svn r500 or so; please tell me if there is some compelling reason to
 keep it.  It appears to me that breaking the connection would make both the
 code and the actual mpl behavior simpler and less surprising, with no loss
 of useful functionality.
 
 I think deprecating lines.color and making the first element of the
 cycle be the default color makes the most sense.

The only problem is that lines.color is the default for LineCollection 
and Line2D, both of which are fairly separate from Axes, so having them 
default to rcParams['axes.color_cycle'][0] seems a little odd.

Eric

--
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
___
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] [Matplotlib-users] define color cycle in matplotlibrc

2010-01-03 Thread John Hunter
On Sun, Jan 3, 2010 at 3:54 PM, Eric Firing efir...@hawaii.edu wrote:
 The only problem is that lines.color is the default for LineCollection and
 Line2D, both of which are fairly separate from Axes, so having them default
 to rcParams['axes.color_cycle'][0] seems a little odd.

Yes, I was worrying about the same thing while cooking dinner :-)  A
line can be added to a Figure or an Axes, so perhaps the default color
should not come from there.  What about a module level attribute
matplotlib.colors.cycle by an rc param colors.cycle and then the
default Line2D and LineCollection color can default to
matplotlib.colors.cycle[0].

--
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
___
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel