Auto color selection PIL

2006-09-27 Thread Xiaolei
Hi, I'm trying to plot some points in an image. Each point has an associating type and I'd like to have different colors (preferrably of high contrast) for different types. The number of types in the data file is unknown a priori. Is there a way to do this at runtime? The "solution" I have so

Re: Initializing a set from a list

2006-06-21 Thread Xiaolei
Sybren Stuvel wrote: > Xiaolei enlightened us with: > > from pylab import * > > You'd better not do that. Just use "import pylab". > > > If I remove the first line, I correctly get: > > > > [1, 2, 3, 3] > > > > set([1, 2, 3]) >

Re: Initializing a set from a list

2006-06-20 Thread Xiaolei
Robert Kern wrote: > Xiaolei Li wrote: > > Hi, > > > > I'm trying to initialize a set from a list but am unable to do so. My > > list "c", looks like: > > > > [(1.00909, 0.91966, -0.13550388182991072, 0), > > (0.87

Initializing a set from a list

2006-06-20 Thread Xiaolei Li
Hi, I'm trying to initialize a set from a list but am unable to do so. My list "c", looks like: [(1.00909, 0.91966, -0.13550388182991072, 0), (0.874239991, 0.7001, -0.2123048713754, 0)] So basically a list of 2 tuples, each with 4 elements. Since tuples are