many plots

Hi All,

First, thanks for a very cool and pretty tool!

My problem is, I have a 2D numpy array, say m by n, and I would like to display the data in n plots (with the same abscissa). That is, the 2D numpy array holds n time series data with m points each. I could use pyplot.plot inside a loop to display it, but n is very large as a result of which it takes a long time to create the plot and display it.

Is there another way to do this more efficiently?

Thanks,
Saurav

Just pass in the 2D array as the ‘y’ argument. A line plot will be made for each column in the 2D array and will even be automatically colored. All lines will show up on the same axes.

Cheers!
Ben Root

···

On Fri, Feb 3, 2012 at 10:27 AM, Saurav Pathak <saurav@…878…3949…> wrote:

Hi All,

First, thanks for a very cool and pretty tool!

My problem is, I have a 2D numpy array, say m by n, and I would like to

display the data in n plots (with the same abscissa). That is, the 2D

numpy array holds n time series data with m points each. I could use

pyplot.plot inside a loop to display it, but n is very large as a result

of which it takes a long time to create the plot and display it.

Is there another way to do this more efficiently?

Thanks,

Saurav

I recommend you to use LineCollection, which should be much efficient.

http://matplotlib.sourceforge.net/examples/api/collections_demo.html

Regards,

-JJ

···

On Sat, Feb 4, 2012 at 1:27 AM, Saurav Pathak <saurav@...3949...> wrote:

Is there another way to do this more efficiently?