python - wxPython GUI: migrating gnuplot to matplotlib -


I currently have a GUI built in wxPython with several sections, one of which is one of the plot. PGG image displays:

  self.plot = wx.bitmapButton (self.pane_system, -1, wx.bitmap ("/ home / myname / projects / newton / plot / src / graph .png ", wx.BITMAP_TYPE_ANY))  

In the second part of the GUI, there is a place where I can edit the parameters. The current setup is that when I change the parameters and press Enter, the code asks to plot Gnuplot again and save the new plot in the graph.png file, then update the GUI to show the updated image.

I have many common questions:

  • I want to migrate gnuplot to maplatlab for the following reasons: If I use Gnuplot, then machine Those running executable should have gnuplot installed machine. On the other hand, matplotlib is a dragon module, so I do not have to worry about installing graphical packages on other machines. Is this belief correct?

  • How can I modify my wxPython GUI window to show a matplot plot? I had told the tutorial many times that there is a way to create a new panel with the Mattplib plot, but I would just like to show it where the old plot was. I think I can do motpllib to save the plot in an image file as I did in Gnuplot. Is it generally a good idea to save the plot as an image and to update the GUI, or to save the other (fast) best practices to update the plots? A defect of using image files (as in the above code) is that when I resize the GUI window, they do not change.

  • If I package it as executable, then do I have to run executable to run wxPython / dragon on a Windows machine?

Order your questions in order:

1.) Yes matplotlib is a contained dragon module. It has external dependencies but these dependencies in Windows have been packaged with matplotlib installation. Do you need to worry about these when you install on other machines? It depends on how you're going to install. Are you packing an exe? After installing Python and MapleLib to end users? As an example you can package matplotlib with py2exe in your x, see. Of course you have to adapt those scripts to your backend, YX.) You are viewing the panels with plots because the maplelib provides a wxWidget taken from wxPanel which plays well with matplotlib. The advantage of using it is that you are looking for wxBitmap for image though its wxBitMapButton

. You can give it a file handle (cStringIO.StringIO) in a matplotlib plot and eliminate the need to write a file on disk. You may possibly hook it up again to the size of the event and get matplotlib to reproduce the figures for the appropriate size. You will not take the amount of flexibility as using the Figure Kanvask WxAgg. I can not do any of these research, however, as it seems that the wxPython web site is down.

3.) You can package wxPython in the executable. Depending on the basis on which you use it depends on how many times I have done it with py2exe.


Comments

Popular posts from this blog

sql - dynamically varied number of conditions in the 'where' statement using LINQ -

asp.net mvc - Dynamically Generated Ajax.BeginForm -

Debug on symbian -