Sorry, I just googled wxmpl and found your page and am now downloading it. I may have a more intelligent question momentarily. You may ignore that part of my response.
Ryan On 3/19/07, Ryan Krauss <[EMAIL PROTECTED]> wrote: > Thanks for your thoughts Ken. Sorry, I assumed a bit on the context > of my comments. I have some data processing utility scripts and I > want to now use with a WX application. The problem is that the > utility modules were written without any thought of this future use in > mind and in all of them I have something like > > from pylab import figure, cla, clf, plot, semiliogx, show, ... > > at the top. This makes them completely incompatible with embedding in > a WX application. So, I need to re-write them and I want to know how > to do that best. John had some suggestions and I had some new > questions as I tried to act on his thoughts. So, the actual plotting > functions don't have to be re-useable in both contexts, but it would > be nice. > > I can't actually run your code because I don't have the wxmpl.py > module. Looking at it, it looks like a really nice set of functions > that work cleanly with embedding in a backend. How could I call one > of the functions from the command line? Could I do something like: > import plotting, pylab > myfig = pylab.figure() > plotting.plot_simple(myfig) > > and would I need any additional commands to actually show the figure? > > Let me know if that makes sense and please send me the wxmpl.py file > or let me know where I can get it. > > Thanks again, > > Ryan > > On 3/19/07, Ken McIvor <[EMAIL PROTECTED]> wrote: > > Ryan, > > > > In my (limited) experience, it's dicey to mix pylab's plotting > > functionality and the OO API. I guess I'm a little unclear exactly > > what your use case is for this. It sounds like you're goal is to > > create a library of functions that operate on Figure instances, > > perhaps so you can use them both interactively and as part of a > > wxPython application. > > > > If that's the case, I'd recommend you try using pylab's gcf() and draw > > () to acquire and redraw the current Figure instance from within > > IPython. You can also save the return value of pylab's figure(), > > which returns a Figure that's already been attached to the > > appropriate renderer. This way you can use the OO API for plotting > > without having to futz with the drawing machinery directly. > > > > This script might give you some ideas about how to structure your > > code. It contains several of the MPL examples re-coded as functions > > that accept a Figure instance and use the OO API for plotting. > > > > http://svn.csrri.iit.edu/mr-software/wxmpl/trunk/demos/plotting.py > > > > Ken > > > ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users