From: Ken M. <mc...@ii...> - 2005-11-30 20:31:03
|
On 11/30/05 11:50, Chris Barker wrote: > massimo sandal wrote: >> Now, my dream would be to embed matplotlib in a full WxPython >> application, instead of using pylab > > That is probably a good way to go. I also agree that this is the way to go. If you're going to be putting a lot of effort into the rest of the application, I'd encourage you to go the extra mile and embed matplotlib rather than using pylab. If nothing else, the result will have a more consistent and polished look. >> but (1)I have read that it requires to rewrite some basic pylab >> facilities If you just embed a FigureCanvasWxAgg you're going to have to write all of the user interaction stuff, like zooming. If you use one of the embedding libraries you get all of that for free. > As any of us write them, we need to contribute them back to MPL, so that > one day, everything will be in the OO interface. You're right, Chris. The only problem is that I see some tension between providing a decent OO API in matplotlib and providing good support for embedding. For example, in WxMpl I chose to favor wxPython's event system over matplotlib's events because I felt it made for a more consistent API for wxPython programmers. >> - Creating a small, pure WxPython application that calls pylab to >> manage graph operations. > > The issue is that pylab expects to manage it's own Frame. You can't have > two wxPython applications in one process, so they will collide, unless > you are talking about running a pylab instance in a separate process. The problem isn't pylab managing its own wx.Frame, but rather that Pylab used to always try to create its own wx.App. It now checks to see if one already exists, so you can to use pylab from your wxPython application without everything blowing up. Ken |