Re: [Matplotlib-users] list of tuples vs tuple of lists

2008-10-23 Thread Brent Pedersen
On Thu, Oct 23, 2008 at 6:35 AM, Michael Droettboom <[EMAIL PROTECTED]> wrote: > You could use the (admittedly inscrutable) "unzip" technique: > > ax.plot_date(*zip(*items)) > > See this blog post for explanation: > > http://paddy3118.blogspot.com/2007/02/unzip-un-needed-in-python.html > > If you u

Re: [Matplotlib-users] list of tuples vs tuple of lists

2008-10-23 Thread Michael Droettboom
You could use the (admittedly inscrutable) "unzip" technique: ax.plot_date(*zip(*items)) See this blog post for explanation: http://paddy3118.blogspot.com/2007/02/unzip-un-needed-in-python.html If you use Numpy arrays, of course, you could use slicing, which, IMHO, is clearer: items = numpy.a

[Matplotlib-users] list of tuples vs tuple of lists

2008-10-23 Thread Thomas Guettler
Hi, I use the API of matplotlib and have a basic problem: Up to now I am used to gather my data into a list of tuples. But matplotlib uses serveral lists instead. Example: me: [(date1, count1), (date2, count2), ...] matplotlib: ax.plot_date(dates, counts) Finally I use something like this q