Embedding in existing application window

Smith, Frank wrote:

I'm really just starting to use it. I've picked wxFloatCanvas mainly
because it's a link between Matplotlib and PythonCard. PythonCard
recently added a FloatCanvas widget as a "component" that can be added
to the main background window of a PythonCard application. Since
FloatCanvas inherits from wxFloatCanvas, and in turn from wxPanel (which
is the basis of the Figure Canvas of MatPlotLib) In answer to your last
question: I was hoping to build a simple plot editor application -
something that can add or remove points, change titles, ticks, fonts,
etc. Although limited, PythonCard has a nice clean and simple structure
that I was hoping to utilize.

It sounds like you need MPL, not FloatCanvas. Trying to put a MPL figure Canvas on top of a FloatCanvas makes no Sense.

The other option is that you could use FloatCanvas all by itself. If your needs for the axis, etc are simple, it could be pretty easy to build what you want, and the interactive part is pretty simple. I've enclosed a simple sample of a moving line plot.

If you decide to go with MPL, I'd start by looking at the code for the PythonCard FloatCanvas widget, and see how it is done. Making a similar wrapper for an MPL Figure Canvas should be straight forward, and I'm sure you'll get help from the PythonCard folks.

However, if you want to edit the plot by point & clicking, you've got a job ahead of you, and it will probably take learning some about wxPython internals.

Good luck,

PS Have you check out Chaco? I haven't been following its development lately, but a while back they had some very nice GUI plot-editing features, using wxPython.

test_Plot.py (6.79 KB)


Christopher Barker, Ph.D.
NOAA/OR&R/HAZMAT (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception