From: John H. <jdh...@ac...> - 2006-05-18 14:08:46
|
>>>>> "Ryan" == Ryan Krauss <rya...@gm...> writes: Ryan> There is a serious flaw to my approach. It seems that if Ryan> plot is called with an explicit linetype like 'b-', then Ryan> ax._get_lines.count is not automatically incremented. You should never use an underscore variable since the leading underscore basically indicates this is an internal variable and it could be removed or changes at any point w/o documentation. If something changes in the "public" API, it will at least be documented in the API_CHANGES file. I think your best approach is to write some helper classes rather than try and set the matplotlib defaults from mycyclers import colorcycler, linecycler for data in mydata: ax.plot(data, linestyle=linecycler(), color=colorcycler()) where linecycler and colorcycler are generators of some sort. Rhen you can alter your linecycler and colorcycler to do whatever you want, make different defaults for color or grayscale, etc... I'm not opposed to making the default linestyles and colorcycles configurable, it has come up a few times, but it may be easier and quicker for you just to code up some custom classes or functions that have just the behavior you want. JDH |