possible to expand the current Colorcycle?

Hi,

Is it possible to expand the colorcycle that matplotlib uses by default?

in axes.py, class _process_plot_var_args, def _clear_color_cycle(self) It seems that self.colors are hardcoded to be self.colors = [‘b’,‘g’,‘r’,‘c’,‘m’,‘y’,‘k’] … is there a way to extend this? (Without changing the matplotlib code directly) I want to be able to extend it by ex. dashed lines or others… i sometimes have a large number of plots to do, and the 7 default plot colors are not enough…

I know I could manually make a handler in my program to handle the colors when I plot… but it would seem nicer if I could just pass a list of plot colors to matplotlib.

Regards,
Soren

I just made a chance in svn to expose the default color list. Here is
an ipython session that shows how to use it:

In [1]: import matplotlib.axes as mplaxes

In [2]: x, y = rand(2,100)

In [3]: plot(x, y, 2*x, 2*y)
Out[3]:
[<matplotlib.lines.Line2D instance at 0x8f2dc8c>,
<matplotlib.lines.Line2D instance at 0x8f2dd6c>]

In [4]: mplaxes._process_plot_var_args.defaultColors = ['red',
'darkslategray', 'wheat']

In [5]: clf()

In [6]: plot(x, y, 2*x, 2*y)

Darren, we might want to expose this in the matplotlib.conf, but
perhaps is it a rare enough request that it is enough to let people
tweak it manually when needed. The only thing that is a bit ugly is
that Axes._process_plot_var_args has the leading underscore indicating
it should not be used outside of mpl, but this is easy enough to
remedy...

JDH

···

On Dec 5, 2007 6:38 AM, Søren Nielsen <soren.skou.nielsen@...287...> wrote:

Hi,

Is it possible to expand the colorcycle that matplotlib uses by default?

in axes.py, class _process_plot_var_args, def _clear_color_cycle(self) It
seems that self.colors are hardcoded to be self.colors =
['b','g','r','c','m','y','k'] ... is there a way to extend this? (Without
changing the matplotlib code directly) I want to be able to extend it by ex.
dashed lines or others.. i sometimes have a large number of plots to do, and
the 7 default plot colors are not enough...

I know I could manually make a handler in my program to handle the colors
when I plot... but it would seem nicer if I could just pass a list of plot
colors to matplotlib.