I wanted to share the enclosed "Fourier Demo" GUI, which is a reimplementation of one of the very first MATLAB GUIs that I worked on at MathWorks in 1993 (right when Handle Graphics was introduced in MATLAB 4). It presents you with two waveforms - a Fourier transform pair - and allows you to manipulate some parameters (via clicking the waveforms and dragging, and controls) and shows how the waveforms are related.
I was very happy about how easily it came together and the performance of the resulting GUI. In particular the matplotlib events and interaction with wx is quite nice, especially the 'hitlist' of matplotlib figures.
Note this is some of my first wx GUI programming so if you see anything that could be handled with a better pattern / class / etc, I am very open to such suggestions!
When I dragged the curve in the time domain window, sometimes I get :
... line 160, in mouseMotion
self.f0.set(1./(1./f0Init+(1./f0Init*(x-x0)/x0)))
ZeroDivisionError: float division
Regards,
Fahri
···
On Sun, Jan 11, 2009 at 9:36 AM, Tom Krauss <tpk@kraussfamily.org> wrote:
To the wxpython / matplotlib community:
I wanted to share the enclosed "Fourier Demo" GUI, which is a
reimplementation of one of the very first MATLAB GUIs that I worked on at
MathWorks in 1993 (right when Handle Graphics was introduced in MATLAB 4).
It presents you with two waveforms - a Fourier transform pair - and allows
you to manipulate some parameters (via clicking the waveforms and dragging,
and controls) and shows how the waveforms are related.
I was very happy about how easily it came together and the performance of
the resulting GUI. In particular the matplotlib events and interaction with
wx is quite nice, especially the 'hitlist' of matplotlib figures.
Note this is some of my first wx GUI programming so if you see anything that
could be handled with a better pattern / class / etc, I am very open to such
suggestions!
this is really a very beautiful example,
so much functionality with so few lines of (still readable) code,
and even not forgotten the tiny details, like the nicely formatted formulas in the figures.
Although MatPlotLib is not part of wxPython (but OGL isn't either),
I would strongly suggest to add this example to the wxPython demos.
I think the example might also be interesting for the following lists:
matplotlib-users@lists.sourceforge.net
scipy-user@scipy.org
I wanted to share the enclosed "Fourier Demo" GUI, which is a reimplementation of one of the very first MATLAB GUIs that I worked on at MathWorks in 1993 (right when Handle Graphics was introduced in MATLAB 4). It presents you with two waveforms - a Fourier transform pair - and allows you to manipulate some parameters (via clicking the waveforms and dragging, and controls) and shows how the waveforms are related.
I was very happy about how easily it came together and the performance of the resulting GUI. In particular the matplotlib events and interaction with wx is quite nice, especially the 'hitlist' of matplotlib figures.
Note this is some of my first wx GUI programming so if you see anything that could be handled with a better pattern / class / etc, I am very open to such suggestions!
Sincerely,
Tom K.
------------------------------------------------------------------------
Hi Stef, thanks for the kind words, I'm glad you like the demo!
I'd be happy to help adding it to the wxPython demos, but I am not sure how
to go about that. It might make sense under a "matplotlib" tab.
As far as those other signal processing demos - very cool, thanks for
sharing! I am not planning on doing anything further like that, my purpose
was to write something to learn wxPython programming better especially with
embedded matplotlib plots. I was thinking about maybe trying something with
images next where the image data responds to the mouse.
However I am also quite interested in contributing to open source since
lately (especially last 2+ years) I've been benefitting tremendously from it
in my work. I guess I wanted to share my simple application because, if I
had had something like this available it would have been helpful, and maybe
now my bit of work can help others. The demo actually builds on some of the
work I saw on embedded matplotlib graphics (that was my starting point for a
wx.Window that contains both a Figure and a canvas) but goes a bit farther
than the stuff I found.
Also, thanks for the suggestions about cross posting, I was planning on
doing so to the matplotlib user's list - I'll try to post the (corrected,
latest) sigdemo.py now.
Regards,
Tom
Stef Mientki-2 wrote:
···
thanks Tom,
this is really a very beautiful example,
so much functionality with so few lines of (still readable) code,
and even not forgotten the tiny details, like the nicely formatted
formulas in the figures.
Although MatPlotLib is not part of wxPython (but OGL isn't either),
I would strongly suggest to add this example to the wxPython demos.
I think the example might also be interesting for the following lists:
matplotlib-users@lists.sourceforge.net
scipy-user@scipy.org
Hi Stef, thanks for the kind words, I'm glad you like the demo!
I'd be happy to help adding it to the wxPython demos, but I am not sure how
to go about that. It might make sense under a "matplotlib" tab.
I'm sure Robin, Andrea G. or Chris B. (oddly enough, they're all guys) can give you some pointers on how to get it included in the demo.
Mike
···
As far as those other signal processing demos - very cool, thanks for
sharing! I am not planning on doing anything further like that, my purpose
was to write something to learn wxPython programming better especially with
embedded matplotlib plots. I was thinking about maybe trying something with
images next where the image data responds to the mouse.
However I am also quite interested in contributing to open source since
lately (especially last 2+ years) I've been benefitting tremendously from it
in my work. I guess I wanted to share my simple application because, if I
had had something like this available it would have been helpful, and maybe
now my bit of work can help others. The demo actually builds on some of the
work I saw on embedded matplotlib graphics (that was my starting point for a
wx.Window that contains both a Figure and a canvas) but goes a bit farther
than the stuff I found.
Also, thanks for the suggestions about cross posting, I was planning on
doing so to the matplotlib user's list - I'll try to post the (corrected,
latest) sigdemo.py now.
Regards,
Tom
Stef Mientki-2 wrote:
thanks Tom,
this is really a very beautiful example,
so much functionality with so few lines of (still readable) code,
and even not forgotten the tiny details, like the nicely formatted formulas in the figures.
Although MatPlotLib is not part of wxPython (but OGL isn't either),
I would strongly suggest to add this example to the wxPython demos.
I think the example might also be interesting for the following lists:
matplotlib-users@lists.sourceforge.net
scipy-user@scipy.org
Hi Stef, thanks for the kind words, I'm glad you like the demo!
I'd be happy to help adding it to the wxPython demos, but I am not sure
how
to go about that. It might make sense under a "matplotlib" tab.
I'm sure Robin, Andrea G. or Chris B. (oddly enough, they're all guys) can
give you some pointers on how to get it included in the demo.
It is a very nice demo indeed, although I am not sure it should be
included in the main wxPython demo. Obviously I have no voice
whatsoever on what should and should not be added to the demo (or to
wxPython itself, these decisions remain always with Robin), but my
impression is that the correct place for your nice demo is Matplotlib
rather than wxPython.
Hi Stef, thanks for the kind words, I'm glad you like the demo!
I'd be happy to help adding it to the wxPython demos, but I am not sure how
to go about that. It might make sense under a "matplotlib" tab.
In this case it might be better to put it on the wiki since it depends on matplotlib. Putting it in the wiki will also give you an opportunity to give more information and to teach the reader how to do what you did.
···
--
Robin Dunn
Software Craftsman http://wxPython.org Java give you jitters? Relax with wxPython!
Hi Stef, thanks for the kind words, I'm glad you like the demo!
I'd be happy to help adding it to the wxPython demos, but I am not sure how
to go about that. It might make sense under a "matplotlib" tab.
In this case it might be better to put it on the wiki since it depends on matplotlib. Putting it in the wiki will also give you an opportunity to give more information and to teach the reader how to do what you did.
Well if you say so ....
... but then I wonder, why there's an opengl demo in the wxPython demo ?
Even with opengl installed it complains about can't find opengl
Hi Stef, thanks for the kind words, I'm glad you like the demo!
I'd be happy to help adding it to the wxPython demos, but I am not sure how
to go about that. It might make sense under a "matplotlib" tab.
In this case it might be better to put it on the wiki since it depends on matplotlib. Putting it in the wiki will also give you an opportunity to give more information and to teach the reader how to do what you did.
Well if you say so ....
... but then I wonder, why there's an opengl demo in the wxPython demo ?
Because wx provides a GLCanvas class for hosting OpenGL drawings. OTOH wx does not provide anything special for integrating with matplotlib, that comes from matplotlib itself.
···
--
Robin Dunn
Software Craftsman http://wxPython.org Java give you jitters? Relax with wxPython!
Folks, thanks for the discussion. I'll try to put it on the wxPyWiki as soon
as I get a chance.
Regards,
Tom
Robin Dunn wrote:
···
Stef Mientki wrote:
Robin Dunn wrote:
Tom K. wrote:
Hi Stef, thanks for the kind words, I'm glad you like the demo!
I'd be happy to help adding it to the wxPython demos, but I am not
sure how
to go about that. It might make sense under a "matplotlib" tab.
In this case it might be better to put it on the wiki since it depends
on matplotlib. Putting it in the wiki will also give you an
opportunity to give more information and to teach the reader how to do
what you did.
Well if you say so ....
... but then I wonder, why there's an opengl demo in the wxPython demo ?
Because wx provides a GLCanvas class for hosting OpenGL drawings. OTOH
wx does not provide anything special for integrating with matplotlib,
that comes from matplotlib itself.
--
Robin Dunn
Software Craftsman http://wxPython.org Java give you jitters? Relax with wxPython!