Re: [Matplotlib-users] Scatter legend with colored marker
Jae-Joon Lee lee.j.j...@... writes: snip In recent versions, there is a separate parameter : scatterpoints. So check your document. ax.legend(sc, labels, scatterpoints=1) Regards, -JJ Great! It works fine with 1.0.0 Jorge -- This SF.net email is sponsored by Make an app they can't live without Enter the BlackBerry Developer Challenge http://p.sf.net/sfu/RIM-dev2dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] Confused/frustrated w/ waitforbuttonpress
Hi, Looking for a way to analyze a set of images I found waitforbuttonpress, which basically does what I need: allows me to display a few plots/scatter/etc for as long as I need; then when pressing a key move to the next image and redo all plots/scatter/etc. Now my problem is that waitforbuttonpress (or the (mis)use I gave it) forces me to close the ipython session frequently and start over again. This is at least inconvenient, and a few times forced me to recalculate things that took some time (and that I had forgot to save). I know this might be backend-related. I use GTKAgg, on ubuntu 10.04, mpl-1.0.0 (locally built). Below you'll find a script I created where I see this behavior, the ipython console's output, and the steps I followed. Steps followed and description: 1- Run script, click mouse a few times (plot is closed and redrawn), finally press a key. The plot is closed, and the console returns to be active. This corresponds to In [1] in the ipython console's output 2- Trying to run anything at the ipython console results in a looong delay and a message like in In [2] at the console. The console works fine after this, though, at least with non matplotlib-related stuff 3- Running the script again results in the output shown in In [3]. The script seems to runs fine, i.e. clicks cause the redrawing of the plot, though pressing any key (which should break the loop and end the script) will end the script but won't close the plot windows. The console works mostly ok, the only way to close the plot window and ipython is by killing the ipython process. 4- In some other cases, I ended up with an unresponsive console that required killing the ipython process as well. This test case is not comprehensive of the things I've experienced, but it might show a possible cause of this behavior. Regards, Jorge Ipython console's output: In [1]: run doct/intrinsic-images/test_waitforbuttonpress.py /home/jscandal/lib/python2.6/site-packages/matplotlib/backend_bases.py:2051: DeprecationWarning: Using default event loop until function specific to this GUI is implemented warnings.warn(str,DeprecationWarning) In [2]: run doct/intrinsic-images/test_waitforbuttonpress.py Warning: Timeout for mainloop thread exceeded switching to nonthreaded mode (until mainloop wakes up again) In [3]: run doct/intrinsic-images/test_waitforbuttonpress.py --- ValueErrorTraceback (most recent call last) /usr/lib/pymodules/python2.6/IPython/Shell.pyc in on_timer(self) 847 848 update_tk(self.tk) -- 849 self.IP.runcode() 850 time.sleep(0.01) 851 return True /usr/lib/pymodules/python2.6/IPython/Shell.pyc in runcode(self) 455 # code modifies it, we restore our own handling. 456 try: -- 457 signal(SIGINT,sigint_handler) 458 except SystemError: 459 # This happens under Windows, which seems to have all sorts ValueError: signal only works in main thread - script used in the test: import numpy as np import matplotlib as mpl import matplotlib.pyplot as plt data = np.random.rand(10,2) while True: fig, ax = plt.subplots(1,1) ax.scatter(data.T[0], data.T[1]) plt.show() if fig.waitforbuttonpress(timeout=-1): plt.close('all') break plt.close('all') -- This SF.net email is sponsored by Make an app they can't live without Enter the BlackBerry Developer Challenge http://p.sf.net/sfu/RIM-dev2dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Confusion Matrix
On 09:29 Sat 31.07.10, Friedrich Romstedt wrote: What you will want to use is .set_tick_params(top=True, labeltop=False, labelbottom=False) . That worked indeed but I have uncovered another problem. It is about the positioning of the rotated labels. The code is here: http://paste.pocoo.org/show/246870/ Note that in line 36 I had already remarked about the hack I used. Now I noticed that if the labels have different lengths rotating them gives different positions. What I really want to do is rotate about the bottom of the labels. Can that be done? Regards Simon -- This SF.net email is sponsored by Make an app they can't live without Enter the BlackBerry Developer Challenge http://p.sf.net/sfu/RIM-dev2dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] installation of matplotlib on OS X 10.5 with python.org Python 2.6
Hi Friedrich,Thanks again for your response. I've been away traveling (with no internet connection) and just returned... hope you can help me troubleshoot this last bit (hopefully last bit)! This is important. I recently had a similar issue (sort of). I think the macports library is 32-bit only, and I know that at least for building Python the build performs 64-bit only by default (this was my issue) on a 64bit system. Of course, in case you want to make a 64bit build against a 32bit library the error would be sensible. To check this, try to run: $ file /opt/local/lib/libxml2.2.dylib When I run it on the Apple supplied file it gives: /usr/lib/libxml2.dylib: Mach-O universal binary with 3 architectures /usr/lib/libxml2.dylib (for architecture x86_64):Mach-O 64-bit dynamically linked shared library x86_64 /usr/lib/libxml2.dylib (for architecture i386):Mach-O dynamically linked shared library i386 /usr/lib/libxml2.dylib (for architecture ppc7400): Mach-O dynamically linked shared library ppcmine gives only:/opt/local/lib/libxml2.2.dylib: Mach-O dynamically linked shared library i386Is this the problem?Thanks so much!Stephen -- This SF.net email is sponsored by Make an app they can't live without Enter the BlackBerry Developer Challenge http://p.sf.net/sfu/RIM-dev2dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] Animation doc glitches
I'm trying to learn how to make a fairly efficient strip chart display and have run into a few glitches: The example strip_chart_demo.py is not annotated but does refer to a page http://www.scipy.org/wikis/topical_software/Animations Unfortunately that page does not exist. I suspect the desired page is: http://www.scipy.org/Cookbook/Matplotlib/Animations However, that page has its own issues: all the links to code that I have tried are broken, e.g.: anim.py = http://matplotlib.sf.net/examples/anim.py anim_tk.py = http://matplotlib.sf.net/examples/anim_tk.py etc. That page also says at one point: For backends that support the new API (GTKAgg) set useblit=True: and As noted above, only the GTKAgg supports the methods above to to the animations of selected actors. However, it earlier claims: As of matplotlib-0.87, GTKAgg, TkAgg, WXAgg, and FLTKAgg support the methods discussed here. If the first two quotes are needlessly restrictive then it would help to list the supported backends once and refer back to that if necessary. These are minor complains. Having found this page it looks pretty straightforward to do what I want (especially since my data rate is slow enough that I can skip the fancy bit blitting). One question: it appears that there is no way to append new data to the Line2D and occasionally flush the oldest data; instead I have to copy all data for every update. Is this so, or am I missing something? -- Russell -- This SF.net email is sponsored by Make an app they can't live without Enter the BlackBerry Developer Challenge http://p.sf.net/sfu/RIM-dev2dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users