Re: [Matplotlib-users] Best way to cycle through numpy images using scroll?

2011-08-17 Thread Tom Dimiduk
Excellent! That sped things up quite a bit. I can now flip through my small images with no perceivable delay. I will look forward to trying out the new interpolation setting when it gets here, since I have some larger images that still lag slightly. If others want, I can repost my code with

Re: [Matplotlib-users] Best way to cycle through numpy images using scroll?

2011-08-17 Thread Benjamin Root
Two issues with your code that should significantly speed things up. First, by calling imshow() each time for the draw, there is significant overhead caused by this. Instead -- (and this is a huge speedup) -- save the object returned by the first call to imshow(). That object has a method ".set_

Re: [Matplotlib-users] Best way to cycle through numpy images using scroll?

2011-08-17 Thread Tom Dimiduk
Here is how am solving this problem. It isn't terribly fast either, but it works for me. I wrote something with pygame that was faster, but it had its own set of problems. Tom --- import numpy as np import pylab class plotter: def __init__(self, im, i=0): self.im = im

Re: [Matplotlib-users] Best way to cycle through numpy images using scroll?

2011-08-17 Thread Keith Hughitt
I'm also looking into a similar issue, and would be interested to see what approaches others have taken. Has anyone found a good framework-independent solution? Keith On Wed, Aug 10, 2011 at 5:15 PM, David Just wrote: > I have an array of images stored as an array of numpy arrays. I need to

[Matplotlib-users] Best way to cycle through numpy images using scroll?

2011-08-16 Thread David Just
I have an array of images stored as an array of numpy arrays. I need to be able to efficiently scroll through that set of images. My first attempt at doing this goes something like this: --init-- self.ax = pyplot.imshow(imgdta[0], interpolation='spline36', cmap=cm.gray, picker=True)

Re: [Matplotlib-users] Best way to cycle through numpy images

2011-08-11 Thread Paul Ivanov
Benjamin Root, on 2011-08-11 11:25, wrote: > On Thu, Aug 11, 2011 at 11:19 AM, David Just wrote: > > --onscroll-- > > self.ax.set_array(imdta[n]) # 0 < n < num_images > > self.canvas.draw() You last line here causes every artist on the canvas to draw. Have you tried blitting jus

Re: [Matplotlib-users] Best way to cycle through numpy images

2011-08-11 Thread Benjamin Root
On Thu, Aug 11, 2011 at 11:43 AM, David Just wrote: > All the images in the pile will be the same dimensions. What I meant was > depending on what pile I load into the viewer, the dimensions of that pile > may differ eg: 150x256x10 to 512x512x150 > > Ok, now I understand. Have you tried sett

Re: [Matplotlib-users] Best way to cycle through numpy images

2011-08-11 Thread Benjamin Root
On Thu, Aug 11, 2011 at 11:34 AM, David Just wrote: > The images are usually ~ 256x256 greyscale. They vary a bit in size, but > are not large by any shape or form. > > It seems interpolation is happening on each scroll. This is evident by > changing the interpolation scheme from linear to spl

Re: [Matplotlib-users] Best way to cycle through numpy images

2011-08-11 Thread Benjamin Root
On Thu, Aug 11, 2011 at 11:19 AM, David Just wrote: > Sorry if this get’s re-posted, my earlier e-mail didn’t seem to go > through. > > I have an array of images stored as an array of numpy arrays. I need to > be able to efficiently scroll through that set of images. My first attempt > at d

[Matplotlib-users] Best way to cycle through numpy images

2011-08-11 Thread David Just
Sorry if this get¹s re-posted, my earlier e-mail didn¹t seem to go through. I have an array of images stored as an array of numpy arrays. I need to be able to efficiently scroll through that set of images. My first attempt at doing this goes something like this: --init-- self.ax = p