Matplotlib using OpenGL

Hi,

I'm looking into using matplotlib as the backend for doing visualization for my dissertation work. This would replace some existing Qt/OpenGL code I've written (but isn't too extensible) for 2D plots of weather radar data (think pcolor style plots). I've been using matplotlib for awhile for other projects, and love it, but it has the drawback that it's interactive graphics are not all that quick (especially pcolor). (Note: I know imshow is faster, but my data are on a polar grid.) I've been spoiled by the speed of OpenGL graphics and the ease of interactive data analysis, so I just can't go back. Has anyone tried making an OpenGL backend? If not, can anyone think of any reason why it couldn't be done, maybe using wx's GLCanvas?

Any comments, or starting points on where I could see how to go about this would be _greatly_ appreciated.

Thanks,

Ryan

···

--
Ryan May
Graduate Research Assistant
School of Meteorology
University of Oklahoma

Ryan May wrote:

Has anyone tried making an OpenGL backend? If not, can anyone think of any reason why it couldn't be done, maybe using wx's GLCanvas?

I don't know enough about OpenGL, but I wonder if it would really help much, as much of the scaling, etc, it happening in MPL code anyway. It could be great for future stuff with more 3-d though.

VTK is worth a look for you, as well.

-Chris

···

--
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception

Chris.Barker@...259...

Ryan May wrote:

Hi,

I'm looking into using matplotlib as the backend for doing visualization for my dissertation work. This would replace some existing Qt/OpenGL code I've written (but isn't too extensible) for 2D plots of weather radar data (think pcolor style plots). I've been using matplotlib for awhile for other projects, and love it, but it has the drawback that it's interactive graphics are not all that quick (especially pcolor). (Note: I know imshow is faster, but my data are on a polar grid.) I've been spoiled by the speed of OpenGL graphics and the ease of interactive data analysis, so I just can't go back. Has anyone tried making an OpenGL backend? If not, can anyone think of any reason why it couldn't be done, maybe using wx's GLCanvas?

Any comments, or starting points on where I could see how to go about this would be _greatly_ appreciated.

I expect pcolor will be slow regardless of the backend. Have you tried pcolormesh? It is a much faster pcolor-workalike, but unfortunately it has a major bug. If I remember correctly, alpha doesn't work right and resizing a window doesn't work right if some data are masked; things that should get erased, don't. I tried to track it down once but got lost in Agg internals. Anyway, try it and see if it is adequate for what you need to do now.

Eric