Re: [Matplotlib-users] Labeling/distinguishing lots of curves on a single plot

2010-08-23 Thread Chloe Lewis
And if you have mutually prime numbers of colors, linestyles, widths, you can automatically generate more distinct lines than I can distinguish... If there's any wxcuse for treating them as a series, I replot when I know how many I have, and space the colors through a colorbar. &C Away from hom

Re: [Matplotlib-users] Labeling/distinguishing lots of curves on a single plot

2010-08-23 Thread John Salvatier
By the way, I found that the following generator expression made things easy: def styles(): return ( {'c' : color, 'ls' : style, 'lw' : width} for color, style, width in itertools.product(colors, linestyles, linewidths)) then you can do something like for result, style in zip(results, styles

Re: [Matplotlib-users] Labeling/distinguishing lots of curves on a single plot

2010-08-23 Thread John Salvatier
Thanks! On Mon, Aug 23, 2010 at 12:38 PM, Aman Thakral wrote: > Hi John, > > Here is a simple way to do it. > > import matplotlib.pyplot as plt > import numpy as np > fig = plt.figure() > ax = fig.add_subplot(111) > > colors = ('red','green','blue','yellow','orange') > linestyles = ('-','--',':'

Re: [Matplotlib-users] Labeling/distinguishing lots of curves on a single plot

2010-08-23 Thread Aman Thakral
Hi John, Here is a simple way to do it. import matplotlib.pyplot as plt import numpy as np fig = plt.figure() ax = fig.add_subplot(111) colors = ('red','green','blue','yellow','orange') linestyles = ('-','--',':') linewidths = (0.5,2) y = np.random.randn(100,30) x = range(y.shape[0]) i = 0 fo

Re: [Matplotlib-users] Labeling/distinguishing lots of curves on a single plot

2010-08-23 Thread Justin McCann
Here are a couple of functions you might try, with a few colors and line styles I use: import itertools from pylab import * COLORS = ['#990033', '#FF', '#00FF00', '#F79E00', '#ff00ff', '#0080FF', '#FF', '#2D0668', '#2EB42E', '#ff6633', '#8000ff', '#33',

[Matplotlib-users] Labeling/distinguishing lots of curves on a single plot

2010-08-23 Thread John Salvatier
Hello, I have a plot with lots of curves on it (say 30), and I would like to have some way of distinguishing the curves from each other. Just plotting them works well for a few curves because they come out as different colors unless you specify otherwise, but if you do too many you start getting r