matplotlib imshow speed

Hi All,

I wrote a program that generates some data and then uses imshow to display it in a FigureCanvasWxAgg and I was curious if it’s possible to get it to display at a reasonable rate. Currently I have it set to 1Hz and it works for a while then slows down over time. I would like to be able to get this running at ~5 Hz. I have this same thing working using wx.BitmapFromBuffer but I would like to add other stuff to it, such as a colorbar and grid so I thought I’d give Matplotlib a go since it already does everything for me.

Any suggestions or links are greatly appreciated.

Best Wishes,

  • Steve

PS: To start it just select the Camera On Radio Button

imshowtest.py (11.9 KB)

After some time spent reading and digging through examples, I found out what my problem was. I was calling imshow each time I wanted to draw my image to the canvas rather than updating the data set with imshow.set_array. I changed my code to initialize imshow once and then make subsequent calls to set_array and canvas.draw. This sped things up a great deal and I am now running ~10Hz.

Cheers,

Steve

···

On Thu, Jun 24, 2010 at 2:07 AM, Steve ghostraker@gmail.com wrote:

Hi All,

I wrote a program that generates some data and then uses imshow to display it in a FigureCanvasWxAgg and I was curious if it’s possible to get it to display at a reasonable rate. Currently I have it set to 1Hz and it works for a while then slows down over time. I would like to be able to get this running at ~5 Hz. I have this same thing working using wx.BitmapFromBuffer but I would like to add other stuff to it, such as a colorbar and grid so I thought I’d give Matplotlib a go since it already does everything for me.

Any suggestions or links are greatly appreciated.

Best Wishes,

  • Steve

PS: To start it just select the Camera On Radio Button