Re: [Matplotlib-users] passing mouse clicks back to a polling application

2007-04-08 Thread belinda thom
Thanks everyone for the advice.

For anyone in my boat following this thread, here's what I ended up  
doing:

Had a stroke of insight and coded the whole thing up (poorly) using  
maptlotlib w/no polling. In other words, the entire API sat in the  
mouse click callback function. Lame, yes---especially since some  
expensive AI search can be going on that takes more than a few  
seconds---but as long as my students take care not to enter more than  
one mouse click before each screen update, the app doesn't seem to  
suffer from inconsistency problems. Its pretty darn nice looking w/ 
matplotlib, too. So, that's the band aid.

I'm sad to hear that its not as easy to use matplotlib to write more  
sophisticated apps than it is w/matlab but am glad that it is  
documented here. To summarize what I gleaned from Chris, the  
maptlotlib (interactive?) thread doesn't handle anything but its own  
stuff (e.g. mouse callbacks) directly, so my attempt to use the  
threading event/wait stuff failed for that reason (?). The pyrobotics  
app would be a good candidate for using matplotlib, but might not be  
easy to use for similar reasons. I am wondering if a socket-based  
approach, where matplotlib served up, for instance, mouse clicks,  
plots, etc, to a client app might be a good compromise.

I am still unclear how John's recs for timer or idler (which I've  
been able to find no accessible documentation on) would have helped  
me. For instance, wouldn't the timer rec fail for the same reason my  
event wait thread hack did? Being sad, however, I understand that the  
main focus of matplotlib is high- and scientific-quality graphics,  
for which it seems to hit the nail on the head.

Francisco's rec to the "for non-programmers programming a GUI"  
document looks very worthwhile (and I am a seasoned programmer). I  
intend to have a serious look at it this summer, b/c I intend to  
write a more serious app using Python that needs a GUI (an audio file  
viewer and editor to be used for my music perception research). The  
document does indeed seem like a good introduction to event-based  
programming, and had I a week or more to spare, would probably have  
tried using the related packages to build the app.

Before the stroke-of-insight, I got lucky and managed to get a simple  
Tk app working that handled displaying the game and processing mouse  
clicks, but I foiled in my attempts to capture keyboard input, so  
after several hours gave up. It does seem wx is more suited for OS X,  
and my brief googling seems to imply that Tk is becoming the thing  
people---esp on OS X---USED to use. I've heard that Apple's own  
InterfaceBuilder is THE WAY to program GUI-based apps and wonder if  
anyone has had experience using this w/Python?

Thanks again for the advice. A last question for Chris...

> If it does look promising, be sure to get the latest version from:
>
> http://www.mithis.com/~chrisb

I never found the time to finish my matplotlib-scipy install from  
source (b/c of the apple's wx incompatibility), but I do intend to  
finish with that business when I return in June and am wondering if  
your above rec about a wx latest-version would interfere with that?

--b



-
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


Re: [Matplotlib-users] Histogram align 'edge' or 'center' bug?

2007-04-08 Thread David Fokkema
On Fri, 2007-04-06 at 18:32 +0300, Jouni K. Seppänen wrote:
> David Fokkema <[EMAIL PROTECTED]> writes:
> 
> > If I choose center, the result is that my histogram is calculated
> > for edge values but the bars are placed at center values which is
> > completely misleading and wrong! I'd say this is a bug, but I may be
> > overlooking something here...
> 
> Looks like a bug to me. Could you file it at
> http://sf.net/tracker/?group_id=80706&atid=560720
> so it isn't forgotten?

Well... It couldn't be too hard to fix, I guess... I know python, I
tracked down the source, I could try and fix it, right? I think I'll
have the time next Tuesday, so hopefully I'll file a bug report with an
attached patch, ;-)


-
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


Re: [Matplotlib-users] matplotlib and py2exe

2007-04-08 Thread Emmanuel

when putting the full path of wxmsw26u_vc_enthought.dll  in setup.py like
this

data_files = [("lib\\matplotlibdata", mpfiles),
   matplotlib.get_py2exe_datafiles(), # if you don't use
the lib option
"C:\\Python24\\Lib\\site-packages\\wx-
2.6.1.0-py2.4-win32.egg\\wx\\wxmsw26u_vc_enthought.dll",
##"wxmsw26u_vc_enthought.dll",
("prog\\", python4dll)
  ]

and copying wxmsw26u_vc_enthought.dll in the same directory where setup.pyis.
Running
python setup.py py2exe
it works "but" gives a 26Mb large dist directory with a lot of files. A good
start.

I'd like to know if it's possible to bundle all files in a zipped files or
something similar

What I obtain in dist is:
[___lib
[___matplolibdata
[___matplotlibdata
[___prog

Files in lib are   *.pyd,library.zip,wxmsw26u_vc_enthought.dll
Files in lib\matplotib are *.afm,*.ppm,*.svg 
Files in matplotib are the same as in lib\matplotib
FIles in prog are MSVCR71.dll,python24.dll,w9xpopen.exe,wx_embed.exe

On 4/8/07, Emmanuel <[EMAIL PROTECTED]> wrote:


Can I post also in that thread or should I open a new one?

I'm also trying the first Werner F. Bruhin example. I saved the setup.pyand the 
example
in embedding_in_wx4.py then I run

python.exe setup.py py2exe bdist


When looking for dll, it fails claiming:
Error: wxmsw26u_vc_enthought.dll : No such file or directory

If I had manually the file
file:///C:/Python24/Lib/site-packages/wx-2.6.1.0-py2.4-win32.egg/wx/wxmsw26_gl_vc_enthought.dll

in the prog directory, it works fine.

If I add wxmsw26_gl_vc_enthought.dll to data_files it does not install in
the prog directory but in the upperlevel directory.

 How could I include it in the right place directly?



On 4/5/07, Werner F. Bruhin <[EMAIL PROTECTED] > wrote:
>
> Hi Archana,
>
> Archana Ganesan wrote:
> > ...
> > trial.py is as follows.
> >
> > from pylab import *
> >
> > x = xrange(10)
> > plot(x)
> > savefig("trial.png")
> >
> The setup.py you are using will not work, it is meant for a matplotlib
> embedded in wx, and even for that some lines are commented out.
>
> Can you try the setup.py I sent yesterday with which I included
> simple_plot.py, which is a script using pylab as you do in your trial.py
> .
>
> Werner
>
>
> -
> 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
>


-
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


Re: [Matplotlib-users] matplotlib and py2exe

2007-04-08 Thread Emmanuel

Can I post also in that thread or should I open a new one?

I'm also trying the first Werner F. Bruhin example. I saved the setup.py and
the example in embedding_in_wx4.py then I run

python.exe setup.py py2exe bdist


When looking for dll, it fails claiming:
Error: wxmsw26u_vc_enthought.dll : No such file or directory

If I had manually the file
file:///C:/Python24/Lib/site-packages/wx-2.6.1.0-py2.4-win32.egg/wx/wxmsw26_gl_vc_enthought.dll
in the prog directory, it works fine.

If I add 
wxmsw26_gl_vc_enthought.dll
to
data_files it does not install in the prog directory but in the upperlevel
directory.

How could I include it in the right place directly?



On 4/5/07, Werner F. Bruhin <[EMAIL PROTECTED]> wrote:


Hi Archana,

Archana Ganesan wrote:
> ...
> trial.py is as follows.
>
> from pylab import *
>
> x = xrange(10)
> plot(x)
> savefig("trial.png")
>
The setup.py you are using will not work, it is meant for a matplotlib
embedded in wx, and even for that some lines are commented out.

Can you try the setup.py I sent yesterday with which I included
simple_plot.py, which is a script using pylab as you do in your trial.py.

Werner

-
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

-
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