[Matplotlib-users] imshow background and/or colour to alpha
Hi, I am trying to do a plot where small images are used as markers at definite coordinate positions (just to make myself clear: I am trying to see how the shape of a polymer changes with different parameters, so I want little "icons" of the polymer placed at the x,y of the parameters). Doing that with imshow() , putting images as sub-matrixes etc. seems doable. However problem is my images have a black background, and correspondingly it seems that the RGB 0,0,0 value of the matrix is shown -kinda correctly- as black (a zeros filled canvas is shown as black). I wonder: Is there a default way to tell imshow() that I want a certain colour (in this case, black) , and that colour only, to be alpha? Or do I have to manually change the matrix? Thanks! m. -- ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] bug with installation from KUBUNTU aptitude
Dmitrey ha scritto: > hi matplotlib developers and users, > let me inform you about the bug: > when I use > sudo aptitude install python-matplotlib > it downloads LOTS of auxilary packages (IIRC about 200 MB for download > and 400 MB for HDD after unpack, or kind of), still it doesn't work > after installation, it yields > > ImportError: No module named _tkinter, please install the python-tk package > > when I install python-tk (1.7 MB for download, very small size in > comparison with those 400 MB), all works OK. This is a dependency bug of the Kubuntu packaging system. It is most probably unrelated to Matplotlib upstream developement. You should report it to the Kubuntu bugzilla (after having looked if it has already been filed). By the way, the LOTS of ausiliary packages are most probably as needed as python-tk to make it work. Don't really understand what you mean by those kind of comparisons, but all complex packages have dependencies. It just seems Kubuntu missed one. Thanks, Massimo -- This SF.net email is sponsored by: SourcForge Community SourceForge wants to tell your story. http://p.sf.net/sfu/sf-spreadtheword ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] R: Newbie question/closing a figure-window
I have the vague remembrance of the fact that IDLE does not play well with matplotlib. Can you try to run the program from the command line and see if it gives the same error? m. -- Massimo Sandal , Ph.D. University of Bologna Department of Biochemistry "G.Moruzzi" snail mail: Via Irnerio 48, 40126 Bologna, Italy email: massimo.san...@unibo.it web: http://www.biocfarm.unibo.it/samori/people/sandal.html tel: +39-051-2094388 fax: +39-051-2094387 -Messaggio originale- Da: Hajas, Wayne [mailto:wayne.ha...@dfo-mpo.gc.ca] Inviato: mar 13/01/2009 21.05 A: matplotlib-users@lists.sourceforge.net Oggetto: [Matplotlib-users] Newbie question/closing a figure-window I'm just getting into matplotlib and python. My apologies if I just haven't found the obvious documentation. I am running XP/Enthought Python 2.5/Idle/matplotlib 0.98.5.2 I run one of the scripts from the tutorial: import numpy as np import matplotlib.pyplot as plt mu, sigma = 100, 15 x = mu + sigma * np.random.randn(1) # the histogram of the data n, bins, patches = plt.hist(x, 50, normed=1, facecolor='g', alpha=0.75) plt.xlabel('Smarts') plt.ylabel('Probability') plt.title('Histogram of IQ') plt.text(60, .025, r'$\mu=100,\ \sigma=15$') plt.axis([40, 160, 0, 0.03]) plt.grid(True) plt.show() A window with the figure appears on my screen. It looks very nice. But now my PYTHON-Shell screen is dead. I can go to the figure window. I right click on the upper-border to close the window. I get the following error message on the PYTHON-Shell. Exception in Tkinter callback Traceback (most recent call last): File "C:\Python25\lib\lib-tk\Tkinter.py", line 1403, in __call__ return self.func(*args) File "C:\Python25\lib\idlelib\MultiCall.py", line 151, in handler r = l[i](event) File "C:\Python25\lib\idlelib\ScriptBinding.py", line 166, in run_module_event interp.runcode(code) File "C:\Python25\lib\idlelib\PyShell.py", line 701, in runcode self.interp.restart_subprocess() AttributeError: ModifiedInterpreter instance has no attribute 'interp' And the shell-window is still dead. I can't do anything else until I close all my Python windows. Is there a better way to close the figure-window? Should I expect IDLE to work with matplotlib? Should I try and figure out Ipython instead? Should I look for a Tkinter installation? My current version is Revision: 50704? Any help or suggestions are appreciated. Wayne Hajas Pacific Biological Station 3190 Hammond Bay Road Nanaimo, BC Canada V9T 6N7 wayne.ha...@dfo-mpo.gc.ca <mailto:haj...@dfo-mpo.gc.ca> (250)756-7367 -- This SF.net email is sponsored by: SourcForge Community SourceForge wants to tell your story. http://p.sf.net/sfu/sf-spreadtheword ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Any news on wxMPL ?
Ken, Thanks a lot for your answer. I am very happy to know that you are alive and (mostly) healthy and that you didn't forget us! :) I'm sorry I didn't reply to your email. It fell through the cracks, so to speak. WxMpl development has been stalled for quite some time now because I developed bilateral carpal tunnel syndrome this past spring. It was not my intention to leave it abandoned and incompatible with matplotlib, but I've been finding everything to be a bit of an uphill battle these days. Woah, how bad. I'm sorry about that, I hope you're somehow recovering. My current plan is to spend some time later this month bringing WxMpl up to date with the API changes. I'd be very pleased to see it hosted as a matplotlib toolkit, so I'll move it over once it's working properly. If someone wants to move the source over and start hacking on it in the interim, please be my guest. Thanks a lot for your interest. I didn't have time to go into the wxmpl source, but another guy (Paulo Meira , [EMAIL PROTECTED] ) did a terrific work in bringing wxmpl up to date. I think you could start by contacting him. I attach his patched wxmpl.py in this mail. What I can say is that it is mostly working, at least for basic plotting, but it has some funny bug here and there (i.e. one of my collegues found on his system that the axes direction flips when zooming). It could be an interesting startpoint. Thanks a lot for your feedback again. I develop a data analysis application that uses wx and MPL and your little library made things much easier. Thanks for your wonderful work. Massimo -- Massimo Sandal , Ph.D. University of Bologna Department of Biochemistry "G.Moruzzi" snail mail: Via Irnerio 48, 40126 Bologna, Italy email: [EMAIL PROTECTED] web: http://www.biocfarm.unibo.it/samori/people/sandal.html tel: +39-051-2094388 fax: +39-051-2094387 wxmpl.py.gz Description: application/gzip begin:vcard fn:Massimo Sandal n:Sandal;Massimo org:University of Bologna;Department of Biochemistry adr:;;Via Irnerio 48;Bologna;;40126;Italy email;internet:[EMAIL PROTECTED] tel;work:+39-051-2094388 tel;fax:+39-051-2094387 x-mozilla-html:FALSE version:2.1 end:vcard -- SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada. The future of the web can't happen without you. Join us at MIX09 to help pave the way to the Next Web now. Learn more and register at http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Any news on wxMPL ?
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Christopher Barker ha scritto: > John Hunter wrote: >> <[EMAIL PROTECTED]> wrote: >>> Yes -- even if Ken does come back online, I'd like to see wxMPL hosted >>> by the MPL project anyway -- it would be easier to find, and more likely >>> to get tested and patched. Maybe as a toolkit? >> I'd be happy to host it in the mpl_toolkits dir if someone brings it >> up to 0.98 and will maintain it. > > That would be great, John. I hope someone can take this on -- I'm doing > non-MPL stuff at the moment, so I can't take it no right now. Maybe in > the future. I would be glad to help, however I'm very unsure about my skills! I'd say I can try to test it these days and help trying to bring it to compliance with 0.98 -but I can't do this alone. In the meantime, would it be possible to host it somewhere in the mpl svn? If not, I can open a google code page for it and use its svn until it's ready. m. -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.7 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFJJzCgpnWWEXZ5PA4RAl64AKDbzIbCectHcly38nLcS0HIr3b8ggCgpka9 ekRxn7Ac56kVqY1DdzHBfxc= =aKto -END PGP SIGNATURE- - This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] Any news on wxMPL ?
Hi, I am a wxMPL user. I use it as a component to blend MPL into a wx GUI for a data analysis application I develop ( http://code.google.com/p/hooke ). I was extremly satisfied by that package, but I've noticed it doesn't play well with latest mpl and needs to be patched. Another wonderful guy on this list (Paulo Meira) managed to patch it get it working but I am receiving reports it could be still buggy and it is a completely unofficial patch. I tried to wrote to Ken McIvor (wxmpl author) about this but received no answer. So, I'd like to know: - Is anyone able to contact Ken McIvor? - Does anyone know about the wxmpl status? - If wxmpl has been abandoned by its author, is there anyone interested (beyond myself) in continuing its development? Thanks a lot, Massimo -- Massimo Sandal , Ph.D. University of Bologna Department of Biochemistry "G.Moruzzi" snail mail: Via Irnerio 48, 40126 Bologna, Italy email: [EMAIL PROTECTED] web: http://www.biocfarm.unibo.it/samori/people/sandal.html tel: +39-051-2094388 fax: +39-051-2094387 begin:vcard fn:Massimo Sandal n:Sandal;Massimo org:University of Bologna;Department of Biochemistry adr:;;Via Irnerio 48;Bologna;;40126;Italy email;internet:[EMAIL PROTECTED] tel;work:+39-051-2094388 tel;fax:+39-051-2094387 x-mozilla-html:FALSE version:2.1 end:vcard - This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Why is wrapper module called "pylab" ?
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 [EMAIL PROTECTED] ha scritto: > So is matplotlib the name of the low level plotting engine? > > And, pylab is the user-friendly wrapper? > > Would it be ok to call the whole system "Pylab" instead of Matplotlib then? Personally I'd say "no" exactly because they are two different things, as you correctly pointed out. m. -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.7 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFJBG/SpnWWEXZ5PA4RAg7nAKCJ1Jo78MApS3FP5t4FFLnMMel8mwCgpCHL JSqrVwgyzX3JAD7y77Iyxnw= =D9oR -END PGP SIGNATURE- - This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] wxmpl incompatibility with matplotlib 0.98.x
Hi, Sorry if bothering you. Here we use a software (that I've written) that is based on wxmpl and matplotlib, among other things. A collegue of mine noticed a problem when installing it on Windows, with the following error: File "hooke.py", line 21, in import wxmpl File "C:\Python25\lib\site-packages\wxmpl.py", line 26, in from matplotlib.axes import PolarAxes, _process_plot_var_args ImportError: cannot import name PolarAxes He was using matplotlib 0.98.3 .Downgrading to 0.91 solved the issue. I remember the same happened when, some month ago, I tried to install the same software on OS X using what were basically SVN versions of mpl, labeled "0.98pre" (see http://macinscience.org/?page_id=6 ) I guess you are probably aware of the problem: are you already working on it :) ? Is there any workaround? I'd like to help you patching it, if within my skills, but I'd need some direction on how the mpl API have been updated. m. -- Massimo Sandal , Ph.D. University of Bologna Department of Biochemistry "G.Moruzzi" snail mail: Via Irnerio 48, 40126 Bologna, Italy email: [EMAIL PROTECTED] web: http://www.biocfarm.unibo.it/samori/people/sandal.html tel: +39-051-2094388 fax: +39-051-2094387 begin:vcard fn:Massimo Sandal n:Sandal;Massimo org:University of Bologna;Department of Biochemistry adr:;;Via Irnerio 48;Bologna;;40126;Italy email;internet:[EMAIL PROTECTED] tel;work:+39-051-2094388 tel;fax:+39-051-2094387 x-mozilla-html:FALSE version:2.1 end:vcard - This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] [OT] Confusion with mailing lists
rex ha scritto: massimo sandal <[EMAIL PROTECTED]> [2007-12-04 09:18]: On a related note, I *hate* that hitting "reply" uses the mail address of the parent poster, instead than that of the mailing list. The scipy and the gentoo mailing list (two other examples I know) behave more properly. Is this a sourceforge quirk? The list follows RFC 2822. The Reply-To header is intended to be created by the originator of the message. List software that overwrites the Reply-To header destroys the function it's intended for. There's an excellent essay on this at: http://woozle.org/~neale/papers/reply-to-still-harmful Mailman implements RFC 2369, which is intended to address this issue. If you want replies to go to the list, I suggest that you use a mail client that follows RFC 2369. If you choose to use old software that doesn't recognize the List-Post header, please don't complain about software that follows RFC standards. Thanks for the article. I read it, and I must say I disagree. This is the tricky part: "Your list software is not "the author of the message", so it must not set or in any way meddle with the Reply-To header. " That's what I think is wrong. When interacting with a mailing list, I assume I'm not interacting just with you or others. I'm receiving mails *from the ML* and sending mails *to the ML*. Not receiving mails from Alice and sending mails to Bob. In other words: A ML, in my experience, is not different from a public forum. When I hit "reply" on a forum, the post goes on the forum, not on the mailbox of the previous poster. I'm all for standards and for consistent behaviour and I understand the logic behind that article; what the authors of the RFC got wrong, in my opinion, it considering a mailing list just as a gigantic CC: by disconnected people instead than of a forum-like object. The fact both use the mail protocol doesn't change the fact they're different objects. But of course that's only a philosophical problem. Thanks to the article I also discovered that "reply to all" sends mail both to the ML and the original sender (Never bothered to try, my fault). Although I find it a little funny. m. -- Massimo Sandal University of Bologna Department of Biochemistry "G.Moruzzi" snail mail: Via Irnerio 48, 40126 Bologna, Italy email: [EMAIL PROTECTED] tel: +39-051-2094388 fax: +39-051-2094387 begin:vcard fn:Massimo Sandal n:Sandal;Massimo org:University of Bologna;Department of Biochemistry adr:;;Via Irnerio 48;Bologna;;40126;Italy email;internet:[EMAIL PROTECTED] tel;work:+39-051-2094388 tel;fax:+39-051-2094387 x-mozilla-html:FALSE version:2.1 end:vcard - SF.Net email is sponsored by: The Future of Linux Business White Paper from Novell. From the desktop to the data center, Linux is going mainstream. Let it simplify your IT future. http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] [OT] Confusion with mailing lists
Robert Dailey ha scritto: What are the different ways one could send an email to a mailing list? On a related note, I *hate* that hitting "reply" uses the mail address of the parent poster, instead than that of the mailing list. The scipy and the gentoo mailing list (two other examples I know) behave more properly. Is this a sourceforge quirk? m. -- Massimo Sandal University of Bologna Department of Biochemistry "G.Moruzzi" snail mail: Via Irnerio 48, 40126 Bologna, Italy email: [EMAIL PROTECTED] tel: +39-051-2094388 fax: +39-051-2094387 begin:vcard fn:Massimo Sandal n:Sandal;Massimo org:University of Bologna;Department of Biochemistry adr:;;Via Irnerio 48;Bologna;;40126;Italy email;internet:[EMAIL PROTECTED] tel;work:+39-051-2094388 tel;fax:+39-051-2094387 x-mozilla-html:FALSE version:2.1 end:vcard - SF.Net email is sponsored by: The Future of Linux Business White Paper from Novell. From the desktop to the data center, Linux is going mainstream. Let it simplify your IT future. http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Update and replot data at a regular time rate
sidimok ha scritto: I would write down an MPL script that loads a block data, generated on the fly (in a file) by another computing program, at a regular time rate, let's say every 30". The script may have an "exit button" to stop it, and it might proceed this way: 1. time = time_old 2. Load the "data" from lines 0 to -1(EOF) 3. Save "data" length: N = len(data) 4. plot 5. After time_new-time_old = time_step 5a. load "data_tmp" from lines N to -1 5b. extend "data" with "data_tmp" 5c. plot 5d. Go back to step 5, or press "Stop" button Does anyone have an idea how to encode this purpose? I don't really understand what the problem is. If you don't you know how to wait a definite time between loading the file, have a look at the time module: http://docs.python.org/lib/module-time.html especially time.sleep() m. -- Massimo Sandal University of Bologna Department of Biochemistry "G.Moruzzi" snail mail: Via Irnerio 48, 40126 Bologna, Italy email: [EMAIL PROTECTED] tel: +39-051-2094388 fax: +39-051-2094387 begin:vcard fn:Massimo Sandal n:Sandal;Massimo org:University of Bologna;Department of Biochemistry adr:;;Via Irnerio 48;Bologna;;40126;Italy email;internet:[EMAIL PROTECTED] tel;work:+39-051-2094388 tel;fax:+39-051-2094387 x-mozilla-html:FALSE version:2.1 end:vcard - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] problem with matplotlib in script
Christoph Scheit ha scritto: Hi, running a python-script using matplotlib I get the following error message: sh: mc: line 1: syntax error: unexpected end of file sh: error importing function definition for `mc' sh: mc: line 1: syntax error: unexpected end of file sh: error importing function definition for `mc' Your errors come from the shell interpreter. It seems that sh, and not python, is parsing the script. Add the following line at the start: #!/usr/bin/env python and try again. m. -- Massimo Sandal University of Bologna Department of Biochemistry "G.Moruzzi" snail mail: Via Irnerio 48, 40126 Bologna, Italy email: [EMAIL PROTECTED] tel: +39-051-2094388 fax: +39-051-2094387 begin:vcard fn:Massimo Sandal n:Sandal;Massimo org:University of Bologna;Department of Biochemistry adr:;;Via Irnerio 48;Bologna;;40126;Italy email;internet:[EMAIL PROTECTED] tel;work:+39-051-2094388 tel;fax:+39-051-2094387 x-mozilla-html:FALSE version:2.1 end:vcard - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Simple Matplotlib usage and Gnuplot
Matt Fago ha scritto: I'm elated to have found matplotlib after struggling with octave and gnuplot. There is one thing that I think matplotlib could improve on (or that I cannot find) -- quick plotting a la gnuplot: plot "file.txt" using 1:2 with lp For matplotlib, perhaps something like the following: fplot("filename", cols=(1,5), delimiter=',', numheader=2) This would allow quick plotting of simple columnar data files, using some (default) assumptions of the file format. I.e, delimiter could be 'intelligently' chosen based on some assumptions of the file, or set explicitly. Similarly for the number of header rows, etc. Are there any plans for such a feature, or does it already exist? Probably would not be too difficult to implement if no one else is planning to do so. IMHO it could be done very easily using the csv python module. I'm currently using a script that does almost exactly that for kernel density estimation. :) If someone holds my hand about mpl guidelines etc., I could try to contribute a general fplot to pylab / mpl. m. -- Massimo Sandal University of Bologna Department of Biochemistry "G.Moruzzi" snail mail: Via Irnerio 48, 40126 Bologna, Italy email: [EMAIL PROTECTED] tel: +39-051-2094388 fax: +39-051-2094387 begin:vcard fn:Massimo Sandal n:Sandal;Massimo org:University of Bologna;Department of Biochemistry adr:;;Via Irnerio 48;Bologna;;40126;Italy email;internet:[EMAIL PROTECTED] tel;work:+39-051-2094388 tel;fax:+39-051-2094387 x-mozilla-html:FALSE version:2.1 end:vcard - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] matplotlib-users@lists.sourceforge.net
Emmanuel Favre-Nicolin ha scritto: Hi, I didn't find any tip for preparation of simple black and white 2D plot, especially for nice output in eps for publication. Any suggestions are welcome. I don't get it. What kind of tips do you need? How to change the plot colour? m. -- Massimo Sandal University of Bologna Department of Biochemistry "G.Moruzzi" snail mail: Via Irnerio 48, 40126 Bologna, Italy email: [EMAIL PROTECTED] tel: +39-051-2094388 fax: +39-051-2094387 begin:vcard fn:Massimo Sandal n:Sandal;Massimo org:University of Bologna;Department of Biochemistry adr:;;Via Irnerio 48;Bologna;;40126;Italy email;internet:[EMAIL PROTECTED] tel;work:+39-051-2094388 tel;fax:+39-051-2094387 x-mozilla-html:FALSE version:2.1 end:vcard - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] . Newbie. Interactive and saving plots to file
[EMAIL PROTECTED] ha scritto: The question is, do people wanting to do this have to edit the matplotlibrc and restart Python each time, or is there some other way? Try to look for savefig() m. -- Massimo Sandal University of Bologna Department of Biochemistry "G.Moruzzi" snail mail: Via Irnerio 48, 40126 Bologna, Italy email: [EMAIL PROTECTED] tel: +39-051-2094388 fax: +39-051-2094387 begin:vcard fn:Massimo Sandal n:Sandal;Massimo org:University of Bologna;Department of Biochemistry adr:;;Via Irnerio 48;Bologna;;40126;Italy email;internet:[EMAIL PROTECTED] tel;work:+39-051-2094388 tel;fax:+39-051-2094387 x-mozilla-html:FALSE version:2.1 end:vcard - 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] passing mouse clicks back to a polling application
Christopher Barker ha scritto: Matplotlib is a plotting library -- it's not a gui development lib. I'd think about using a tool designed for the job. I don't know what you want the graphics of your game to look like, but depending on that, some suggestions: PyGame -- good for fancy raster graphics, not so good if you have a need for other GUI elements -- all the typical controls, text boxes etc. TkInter -- it has a Canvas people like a lot that gives a lot of flexibility. wxPython -- The wxPython FloatCanvas (full disclosure -- it's my baby) could probably help you out a lot here, if you're dealing with vector graphics, and particularly if you want zooming and panning. I'm sure you could do it with pyGTK or pyQT also. Deciding between all these options is hard, they all have their strengths. What's best for you is a function of what the needs of your app are, what your future needs may be, what platforms you need to support, and taste. Even if MPL is a perfect fit for your graphics, if you get beyond a basic "calculate and plot" app, you'll probably want to use MPL embedded in a GUI toolkit, TK, GTK or wx. I fully endorse what it's said here. I only want to add: Don't let yourself confused by the fact that most MPL documentation makes references to Pylab. This is a really confusing aspect that I've already pointed out in this ml. MPL is a fully featured Python plotting library. It is conceived (also) to be used inside a fully featured GUI app, and addons like wxMPL make the merging quite painless. Pylab is a Pythonic interactive environment that makes use of MPL and it's good for people that already have confidence with python AND want an interactive environment for quick scripts and interaction à là Matlab. But MPL is *much more* than Pylab. m. -- Massimo Sandal University of Bologna Department of Biochemistry "G.Moruzzi" snail mail: Via Irnerio 48, 40126 Bologna, Italy email: [EMAIL PROTECTED] tel: +39-051-2094388 fax: +39-051-2094387 begin:vcard fn:Massimo Sandal n:Sandal;Massimo org:University of Bologna;Department of Biochemistry adr:;;Via Irnerio 48;Bologna;;40126;Italy email;internet:[EMAIL PROTECTED] tel;work:+39-051-2094388 tel;fax:+39-051-2094387 x-mozilla-html:FALSE version:2.1 end:vcard - 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] [SciPy-user] question about standalone small software and teaching
Giorgio Luciano ha scritto: At first I thought ... hey why people wat an interface, just use the console, and then after listening to their reason I have to agree. What do I generally do ? I have a matrix in txt, I apply my routines (a SVD, a PCA, a filter etc etc written in python), plot them (using maplotlib) and then I want an output. that's it. I started looking at various Qt etc. etc. but for me it's overhelming, because I think that the most important part should be dedicate to the routines creation and not to making a gui, compiling, etc. etc. I need simple command like people wants. grids, paste and copy, small working plots :) I mean I can get crazy with setting my program, importing etc. etc. but I also have to say that needs and claim about writing simple guis, common paste and copy etc should be considered from someone there (we wait for the help of some guru that makes things easier ;) It's quite hard for me to understand what you mean. Anyway, I solved the issue of usability vs code simplicity for my data analysis application by using a mixed CLI+GUI design. That is, I have a very simple GUI that just shows the plot and may have some button/menu for basic operations, and a custom command line to finely work with it. Think of RasMol, for example. The custom command line is done with the Python Cmd module that is included with Python, and it's a breeze to code with. The GUI uses Matplotlib embedded with wxMPL in a wxPython frame. The command line and the GUI are threaded (work on two different threads) that communicate by passing events (cli-->gui) and with a Queue (gui-->cli): easy. Anyway, I'd advice you to learn wxPython basics. It's powerful, free, multiplatform and it's becoming the default Python GUI toolkit in the wild. Learning a GUI toolkit cannot harm. If you can, buy the Robin Dunn book "wxPython in Action", it's wonderful to say the least. m. -- Massimo Sandal University of Bologna Department of Biochemistry "G.Moruzzi" snail mail: Via Irnerio 48, 40126 Bologna, Italy email: [EMAIL PROTECTED] tel: +39-051-2094388 fax: +39-051-2094387 begin:vcard fn:Massimo Sandal n:Sandal;Massimo org:University of Bologna;Department of Biochemistry adr:;;Via Irnerio 48;Bologna;;40126;Italy email;internet:[EMAIL PROTECTED] tel;work:+39-051-2094388 tel;fax:+39-051-2094387 x-mozilla-html:FALSE version:2.1 end:vcard - 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] how to plot
javi markez bigara ha scritto: hi everyone, i would like to know how to plot several linear regresions with the same group of points THANKS IN ADVANCE what do you mean? however, if you dig the matplotlib and the scipy documentation, you'll find (a)how to plot points (easy) (b)how to calculate linear regressions (this one is less straightforward than it should be, however now I don't remember the details - I can check my code if you have trouble in finding it by yourself). do you use pylab or matplotlib embedded in something? m. -- Massimo Sandal University of Bologna Department of Biochemistry "G.Moruzzi" snail mail: Via Irnerio 48, 40126 Bologna, Italy email: [EMAIL PROTECTED] tel: +39-051-2094388 fax: +39-051-2094387 begin:vcard fn:Massimo Sandal n:Sandal;Massimo org:University of Bologna;Department of Biochemistry adr:;;Via Irnerio 48;Bologna;;40126;Italy email;internet:[EMAIL PROTECTED] tel;work:+39-051-2094388 tel;fax:+39-051-2094387 x-mozilla-html:FALSE version:2.1 end:vcard - 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] matlab, idle, interactivity and teaching
Giorgio Luciano ha scritto: I'm aware that python/scipy were not started as a clone matlab (well matlibplot was started as something similar ;) Yes, matplotlib AFAIK wanted (and probably wants) to be something similar, and it's bad, because mpl is too good in itself to be forced to be just a matlab ripoff! :) and also that they should be taught as an language (and that's why I prefer to use it an not to shol very useful programs like OCTAVE od Scilab.. it's better for students to hava a curriculum with a true programming language than with a metalanguage). That's really good and I fully agree. I have to admit also that if someone there sooner or later would create a workspace similar to matlab (with paste and copy, and more interactive feature without tweaking too much) a lot more people would be glade to replace their matlab with scipy/matplotlib. A pythonic interacting environment IMHO should be a nice application in itself to write. It should have its own shell instead of relying on ipython (that is, it should not be a python shell, or a python shell *really* on steroids). I'd like to hear the pylab guys to know what they think. m. -- Massimo Sandal University of Bologna Department of Biochemistry "G.Moruzzi" snail mail: Via Irnerio 48, 40126 Bologna, Italy email: [EMAIL PROTECTED] tel: +39-051-2094388 fax: +39-051-2094387 begin:vcard fn:Massimo Sandal n:Sandal;Massimo org:University of Bologna;Department of Biochemistry adr:;;Via Irnerio 48;Bologna;;40126;Italy email;internet:[EMAIL PROTECTED] tel;work:+39-051-2094388 tel;fax:+39-051-2094387 x-mozilla-html:FALSE version:2.1 end:vcard - 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] matlab, idle, interactivity and teaching
> Not quite a 'development environment', but a long way towards one. I always thought that the focus of matplotlib towards matlab-like interactivity is fundamentally flawed. Matlab-like interactivity is damn good when it is needed, but for that purpose in the free world there are already the good Octave, Gnuplot and Scilab. The big strength of matplotlib is that it is Python -that is, it is built on top of a general purpose language that is both very powerful and a breeze to code with. I would like to see matplotlib being pushed as a scientific plotting development library and environment, with pylab being a nice add-on for people accustomed with python and wanting a python-friendly interactive plot. Today matplotlib is marketed viceversa, and in my opinion this confuses newcomers (that see a programming language being used as an interactive command line environment) and doesn't help who wants to use matplotlib as what it is -a python library- with full power (I was *extremly* confused when I started to dig matplotlib to build a wx application and *everything* I found starting with was a reference to pylab...) So, coming back to Giorgio question, I'd like to advice him to teach matplotlib+scipy to his students as a programming environment first, letting them learn Python, and *after* showing them that there is a pythonic interactive environment. m. -- Massimo Sandal University of Bologna Department of Biochemistry "G.Moruzzi" snail mail: Via Irnerio 48, 40126 Bologna, Italy email: [EMAIL PROTECTED] tel: +39-051-2094388 fax: +39-051-2094387 begin:vcard fn:Massimo Sandal n:Sandal;Massimo org:University of Bologna;Department of Biochemistry adr:;;Via Irnerio 48;Bologna;;40126;Italy email;internet:[EMAIL PROTECTED] tel;work:+39-051-2094388 tel;fax:+39-051-2094387 x-mozilla-html:FALSE version:2.1 end:vcard - 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] Very odd problem of installation of matplotlib/numpy on XP
massimo sandal ha scritto: Giorgio Luciano ha scritto: No any other with the same problem :( ? No. But I googled for you and I found this: http://mail.python.org/pipermail/python-list/2006-November/412228.html Maybe you can get some hint. Oh, ok, checked better your email and that email -no big difference. Basically the problem seems to be in the order you are building the packages, or in version (in)compatibility. Are you sure that you are always using the same order? I find quite odd you install matplotlib *before* scipy -it should be the contrary. Are you sure these are the same packages compiled in the same way from the same source? m. -- Massimo Sandal University of Bologna Department of Biochemistry "G.Moruzzi" snail mail: Via Irnerio 48, 40126 Bologna, Italy email: [EMAIL PROTECTED] tel: +39-051-2094388 fax: +39-051-2094387 begin:vcard fn:Massimo Sandal n:Sandal;Massimo org:University of Bologna;Department of Biochemistry adr:;;Via Irnerio 48;Bologna;;40126;Italy email;internet:[EMAIL PROTECTED] tel;work:+39-051-2094388 tel;fax:+39-051-2094387 x-mozilla-html:FALSE version:2.1 end:vcard - 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] Very odd problem of installation of matplotlib/numpy on XP
Giorgio Luciano ha scritto: No any other with the same problem :( ? No. But I googled for you and I found this: http://mail.python.org/pipermail/python-list/2006-November/412228.html Maybe you can get some hint. m. -- Massimo Sandal University of Bologna Department of Biochemistry "G.Moruzzi" snail mail: Via Irnerio 48, 40126 Bologna, Italy email: [EMAIL PROTECTED] tel: +39-051-2094388 fax: +39-051-2094387 begin:vcard fn:Massimo Sandal n:Sandal;Massimo org:University of Bologna;Department of Biochemistry adr:;;Via Irnerio 48;Bologna;;40126;Italy email;internet:[EMAIL PROTECTED] tel;work:+39-051-2094388 tel;fax:+39-051-2094387 x-mozilla-html:FALSE version:2.1 end:vcard - 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
[Matplotlib-users] flipping x-y axes?
Hi, What is the method used to flip axes in X and/or Y direction in the matplotlib API? that is, to plot something with values from positive to negative instead of the contrary? Maybe it's me being dense :), but I can't find how to do it. Thanks! m. -- Massimo Sandal University of Bologna Department of Biochemistry "G.Moruzzi" snail mail: Via Irnerio 48, 40126 Bologna, Italy email: [EMAIL PROTECTED] tel: +39-051-2094388 fax: +39-051-2094387 begin:vcard fn:Massimo Sandal n:Sandal;Massimo org:University of Bologna;Department of Biochemistry adr:;;Via Irnerio 48;Bologna;;40126;Italy email;internet:[EMAIL PROTECTED] tel;work:+39-051-2094388 tel;fax:+39-051-2094387 x-mozilla-html:FALSE version:2.1 end:vcard - 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/wxmpl/numpy conflict on windows xp: runtime error, C-API ?
Charlie Moad ha scritto: I am guessing you installed numpy1.0b1. You need to use 0.9.8. Thanks a lot. I uninstalled 1.01b1 and installed 0.9.8 and everything workes perfectly. Thanks again, Massimo -- Massimo Sandal University of Bologna Department of Biochemistry "G.Moruzzi" snail mail: Via Irnerio 48, 40126 Bologna, Italy email: [EMAIL PROTECTED] tel: +39-051-2094388 fax: +39-051-2094387 begin:vcard fn:Massimo Sandal n:Sandal;Massimo org:University of Bologna;Department of Biochemistry adr:;;Via Irnerio 48;Bologna;;40126;Italy email;internet:[EMAIL PROTECTED] tel;work:+39-051-2094388 tel;fax:+39-051-2094387 x-mozilla-html:FALSE version:2.1 end:vcard - 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
[Matplotlib-users] matplotlib/wxmpl/numpy conflict on windows xp: runtime error, C-API ?
Hi, I'm trying to install a matplotlib+wxmpl app I wrote on Linux on a Windows XP machine. It crashes starting with the following error: - C:\Documents and Settings\Principale\Desktop\Python\Hooke>python hooke.py Traceback (most recent call last): File "hooke.py", line 12, in ? import wxmpl File "C:\Programmi\Python23\Lib\site-packages\wxmpl.py", line 26, in ? from matplotlib.axes import PolarAxes, _process_plot_var_args File "C:\PROGRA~1\Python23\Lib\site-packages\matplotlib\axes.py", line 23, in ? from contour import ContourSet File "C:\PROGRA~1\Python23\Lib\site-packages\matplotlib\contour.py", line 18, in ? import _contour File "C:\PROGRA~1\Python23\Lib\site-packages\matplotlib\_contour.py", line 17, in ? from matplotlib._ns_cntr import * RuntimeError: module compiled against version 90709 of C-API but this version of numpy is 100 - I installed the latest sourceforge stable (not CVS/SVN) versions of matplotlib, numpy and wxmpl as of today. I'm quite puzzled, I guess I understand what the error is (different gcc versions?), but how can I get around it? Do I need to recompile numpy/matplotlib? m. -- Massimo Sandal University of Bologna Department of Biochemistry "G.Moruzzi" snail mail: Via Irnerio 48, 40126 Bologna, Italy email: [EMAIL PROTECTED] tel: +39-051-2094388 fax: +39-051-2094387 begin:vcard fn:Massimo Sandal n:Sandal;Massimo org:University of Bologna;Department of Biochemistry adr:;;Via Irnerio 48;Bologna;;40126;Italy email;internet:[EMAIL PROTECTED] tel;work:+39-051-2094388 tel;fax:+39-051-2094387 x-mozilla-html:FALSE version:2.1 end:vcard - 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] OSError when exporting figure in EPS
Fernando Perez ha scritto: This shows the benefits of 'xmode verbose' :) There's enough info in that traceback to understand the problem: This is the call that fails. To confirm this is the problem, try: shutil.move('/tmp/foo','/fat32partition/foo') With any valid /tmp/foo file and your actual path to your fat32 partition. Yes, it fails in the same way: In [5]: xmode verbose Exception reporting mode: Verbose In [6]: shutil.move('/tmp/tmp_Tzxny','/users/Massimo/') --- exceptions.OSError Traceback (most recent call last) /home/massimo/ /usr/lib/python2.4/shutil.py in move(src='/tmp/tmp_Tzxny', dst='/users/Massimo/') 191 rmtree(src) 192 else: --> 193 copy2(src,dst) global copy2 = src = '/tmp/tmp_Tzxny' dst = '/users/Massimo/' 194 os.unlink(src) 195 /usr/lib/python2.4/shutil.py in copy2(src='/tmp/tmp_Tzxny', dst='/users/Massimo/tmp_Tzxny') 91 dst = os.path.join(dst, os.path.basename(src)) 92 copyfile(src, dst) ---> 93 copystat(src, dst) global copystat = src = '/tmp/tmp_Tzxny' dst = '/users/Massimo/tmp_Tzxny' 94 95 /usr/lib/python2.4/shutil.py in copystat(src='/tmp/tmp_Tzxny', dst='/users/Massimo/tmp_Tzxny') 66 mode = stat.S_IMODE(st.st_mode) 67 if hasattr(os, 'utime'): ---> 68 os.utime(dst, (st.st_atime, st.st_mtime)) global os.utime = dst = '/users/Massimo/tmp_Tzxny' st.st_atime = 1150188691 st.st_mtime = 1149762561 69 if hasattr(os, 'chmod'): 70 os.chmod(dst, mode) OSError: [Errno 1] Operation not permitted: '/users/Massimo/tmp_Tzxny' which in turn tries to call utime(): /usr/lib/python2.4/shutil.py in copystat(src='/tmp/caba709a5ee736ae3148af077a1a9a38', dst='prova.eps') 66 mode = stat.S_IMODE(st.st_mode) 67 if hasattr(os, 'utime'): ---> 68 os.utime(dst, (st.st_atime, st.st_mtime)) global os.utime = dst = 'prova.eps' st.st_atime = 1150101622 st.st_mtime = 1150101622 69 if hasattr(os, 'chmod'): 70 os.chmod(dst, mode) OSError: [Errno 1] Operation not permitted: 'prova.eps' is somehow not OK for fat32 partitions, or because you don't have the right permissions on your system. > You need to be sure that you have your fat32 partition mounted with > the right user permissions, otherwise things like these can fail. My /etc/mtab line for the partition is as follows: /dev/hda7 /users vfat rw,utf8,umask=000,gid=46 0 0 this should mean everyone has full permissions on the partition, isn't it? At this point, it's not yet clear if this is a problem with backend_ps in mpl or your permissions configuration. 5-minute googling lets me wonder if it's a problem with os.utime() not always playing nice with fat32 partitions... odd because on my previous debian sarge with the same configuration, it didn't complain. m. -- Massimo Sandal University of Bologna Department of Biochemistry "G.Moruzzi" snail mail: Via Irnerio 48, 40126 Bologna, Italy email: [EMAIL PROTECTED] tel: +39-051-2094388 fax: +39-051-2094387 begin:vcard fn:Massimo Sandal n:Sandal;Massimo org:University of Bologna;Department of Biochemistry adr:;;Via Irnerio 48;Bologna;;40126;Italy email;internet:[EMAIL PROTECTED] tel;work:+39-051-2094388 tel;fax:+39-051-2094387 x-mozilla-html:FALSE version:2.1 end:vcard ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] OSError when exporting figure in EPS
Thanks, Massimo, I'm away from my ubuntu machine right now, so I can't test this. In the meantime, try in ipython xmode verbose before running your code. This will generate a more detailed traceback, which might give us some clues. I noticed that I get the error only when I write on a FAT32 partition that I use to exchange file with Windows. Writing on my /home ext3 partition gives no error. I guess MPL is trying to put some attribute on the saved file that is not supported by FAT32. Down here there's the "xmode verbose" traceback In [11]: savefig('prova.eps') --- exceptions.OSError Traceback (most recent call last) /users/Massimo/synuclein/ /usr/lib/python2.4/site-packages/matplotlib/pylab.py in savefig(*args=('prova.eps',), **kwargs={}) 809 def savefig(*args, **kwargs): 810 fig = gcf() --> 811 return fig.savefig(*args, **kwargs) fig.savefig = > args = ('prova.eps',) kwargs = {} 812 if Figure.savefig.__doc__ is not None: 813 savefig.__doc__ = _shift_string(Figure.savefig.__doc__) /usr/lib/python2.4/site-packages/matplotlib/figure.py in savefig(self=, *args=('prova.eps',), **kwargs={'dpi': 100.0, 'edgecolor': 'white', 'facecolor': 'white'}) 658 kwargs[key] = rcParams['savefig.%s'%key] 659 --> 660 self.canvas.print_figure(*args, **kwargs) self.canvas.print_figure = FigureCanvasPS.print_figure of > args = ('prova.eps',) kwargs = {'edgecolor': 'white', 'facecolor': 'white', 'dpi': 100.0} 661 662 def colorbar(self, mappable, cax=None, **kw): /usr/lib/python2.4/site-packages/matplotlib/backends/backend_ps.py in print_figure(self=instance>, outfile='prova.eps', dpi=100.0, facecolor='white', edgecolor='white', orientation='portrait', papertype='letter') 1121 fh = file(tmpfile) 1122 print >>outfile, fh.read() -> 1123 else: shutil.move(tmpfile, outfile) global shutil.move = tmpfile = '/tmp/caba709a5ee736ae3148af077a1a9a38' outfile = 'prova.eps' 1124 1125 def _print_figure_tex(self, outfile, dpi, facecolor, edgecolor, orientation, /usr/lib/python2.4/shutil.py in move(src='/tmp/caba709a5ee736ae3148af077a1a9a38', dst='prova.eps') 191 rmtree(src) 192 else: --> 193 copy2(src,dst) global copy2 = src = '/tmp/caba709a5ee736ae3148af077a1a9a38' dst = 'prova.eps' 194 os.unlink(src) 195 /usr/lib/python2.4/shutil.py in copy2(src='/tmp/caba709a5ee736ae3148af077a1a9a38', dst='prova.eps') 91 dst = os.path.join(dst, os.path.basename(src)) 92 copyfile(src, dst) ---> 93 copystat(src, dst) global copystat = src = '/tmp/caba709a5ee736ae3148af077a1a9a38' dst = 'prova.eps' 94 95 /usr/lib/python2.4/shutil.py in copystat(src='/tmp/caba709a5ee736ae3148af077a1a9a38', dst='prova.eps') 66 mode = stat.S_IMODE(st.st_mode) 67 if hasattr(os, 'utime'): ---> 68 os.utime(dst, (st.st_atime, st.st_mtime)) global os.utime = dst = 'prova.eps' st.st_atime = 1150101622 st.st_mtime = 1150101622 69 if hasattr(os, 'chmod'): 70 os.chmod(dst, mode) OSError: [Errno 1] Operation not permitted: 'prova.eps' -- Massimo Sandal University of Bologna Department of Biochemistry "G.Moruzzi" snail mail: Via Irnerio 48, 40126 Bologna, Italy email: [EMAIL PROTECTED] tel: +39-051-2094388 fax: +39-051-2094387 begin:vcard fn:Massimo Sandal n:Sandal;Massimo org:University of Bologna;Department of Biochemistry adr:;;Via Irnerio 48;Bologna;;40126;Italy email;internet:[EMAIL PROTECTED] tel;work:+39-051-2094388 tel;fax:+39-051-2094387 x-mozilla-html:FALSE version:2.1 end:vcard ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] OSError when exporting figure in EPS
Darren Dale ha scritto: I noticed the following error when in my application I try to export the plot in EPS format. The odd thing is that the export actually works and produces a good eps file, but nevertheless... File "hooke.py", line 354, in ExportImage #that's my wxpython+MPL app self.figure.savefig(filename) File "/usr/lib/python2.4/site-packages/matplotlib/figure.py", line 660, in savefig self.canvas.print_figure(*args, **kwargs) File "/usr/lib/python2.4/site-packages/matplotlib/backends/backend_ps.py", line 1123, in print_figure else: shutil.move(tmpfile, outfile) File "/usr/lib/python2.4/shutil.py", line 193, in move copy2(src,dst) File "/usr/lib/python2.4/shutil.py", line 93, in copy2 copystat(src, dst) File "/usr/lib/python2.4/shutil.py", line 68, in copystat os.utime(dst, (st.st_atime, st.st_mtime)) OSError: [Errno 1] Operation not permitted: 'figura001.eps' please submit a short script that reproduces the problem. I have just reproduced it by doing an histogram in an interactive ipython --pylab session and then exporting as 'figure.eps'. Just: a=[...] <--numbers to histogram hist(a) savefig('hist001.eps') gives: exceptions.OSError Traceback (most recent call last) /users/Massimo/synuclein/ /usr/lib/python2.4/site-packages/matplotlib/pylab.py in savefig(*args, **kwargs) 809 def savefig(*args, **kwargs): 810 fig = gcf() --> 811 return fig.savefig(*args, **kwargs) 812 if Figure.savefig.__doc__ is not None: 813 savefig.__doc__ = _shift_string(Figure.savefig.__doc__) /usr/lib/python2.4/site-packages/matplotlib/figure.py in savefig(self, *args, **kwargs) 658 kwargs[key] = rcParams['savefig.%s'%key] 659 --> 660 self.canvas.print_figure(*args, **kwargs) 661 662 def colorbar(self, mappable, cax=None, **kw): /usr/lib/python2.4/site-packages/matplotlib/backends/backend_gtkagg.py in print_figure(self, filename, dpi, facecolor, edgecolor, orientation, **kwargs) 110 try: 111 agg.print_figure(filename, dpi, facecolor, edgecolor, --> 112 orientation, **kwargs) 113 except IOError, msg: 114 error_msg_gtk('Failed to save\nError message: %s'%(msg,), self) /usr/lib/python2.4/site-packages/matplotlib/backends/backend_agg.py in print_figure(self, filename, dpi, facecolor, edgecolor, orientation, **kwargs) 482 ps = self.switch_backends(FigureCanvasPS) 483 ps.print_figure(filename, dpi, facecolor, edgecolor, --> 484 orientation, **kwargs) 485 else: 486 raise IOError('Do not know know to handle extension *%s' % ext) /usr/lib/python2.4/site-packages/matplotlib/backends/backend_ps.py in print_figure(self, outfile, dpi, facecolor, edgecolor, orientation, papertype) 1121 fh = file(tmpfile) 1122 print >>outfile, fh.read() -> 1123 else: shutil.move(tmpfile, outfile) 1124 1125 def _print_figure_tex(self, outfile, dpi, facecolor, edgecolor, orientation, /usr/lib/python2.4/shutil.py in move(src, dst) 191 rmtree(src) 192 else: --> 193 copy2(src,dst) 194 os.unlink(src) 195 /usr/lib/python2.4/shutil.py in copy2(src, dst) 91 dst = os.path.join(dst, os.path.basename(src)) 92 copyfile(src, dst) ---> 93 copystat(src, dst) 94 95 /usr/lib/python2.4/shutil.py in copystat(src, dst) 66 mode = stat.S_IMODE(st.st_mode) 67 if hasattr(os, 'utime'): ---> 68 os.utime(dst, (st.st_atime, st.st_mtime)) 69 if hasattr(os, 'chmod'): 70 os.chmod(dst, mode) OSError: [Errno 1] Operation not permitted: 'hist001.eps' MPL is 0.87.3 compiled from source on gnu/linux Kubuntu 6.06 Thanks, m. -- Massimo Sandal University of Bologna Department of Biochemistry "G.Moruzzi" snail mail: Via Irnerio 48, 40126 Bologna, Italy email: [EMAIL PROTECTED] tel: +39-051-2094388 fax: +39-051-2094387 begin:vcard fn:Massimo Sandal n:Sandal;Massimo org:University of Bologna;Department of Biochemistry adr:;;Via Irnerio 48;Bologna;;40126;Italy email;internet:[EMAIL PROTECTED] tel;work:+39-051-2094388 tel;fax:+39-051-2094387 x-mozilla-html:FALSE version:2.1 end:vcard ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] "X Error: BadDevice" when initializing matplotlib
Hi, I recently installed matplotlib 0.87.3 (compiled from source) on a kubuntu 6.06 I notice, both when using mpl embedded into an application and when using it with pylab, that before drawing a new graph window the following error happens: X Error: BadDevice, invalid or uninitialized input device 168 Major opcode: 145 Minor opcode: 3 Resource id: 0x0 Failed to open device X Error: BadDevice, invalid or uninitialized input device 168 Major opcode: 145 Minor opcode: 3 Resource id: 0x0 Failed to open device The graph is then correctly displayed and everything then proceeds normally, but I guess it is not completely normal it happens (an old matplotlib version on debian sarge gave no errors). Thanks, m. -- Massimo Sandal University of Bologna Department of Biochemistry "G.Moruzzi" snail mail: Via Irnerio 48, 40126 Bologna, Italy email: [EMAIL PROTECTED] tel: +39-051-2094388 fax: +39-051-2094387 begin:vcard fn:Massimo Sandal n:Sandal;Massimo org:University of Bologna;Department of Biochemistry adr:;;Via Irnerio 48;Bologna;;40126;Italy email;internet:[EMAIL PROTECTED] tel;work:+39-051-2094388 tel;fax:+39-051-2094387 x-mozilla-html:FALSE version:2.1 end:vcard ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] [SciPy-user] linear_least_squares: OverFlow error or flapack.error
Ok, I guess I found the problem is in my code (the arrays I'm passing are indeed empty for some reason, not surprising it can't line fit them). So high shame on me for having polluted the mailing list :( A lesson in humility (and debugging) indeed. Thanks anyway... I flee in shame. m. -- Massimo Sandal University of Bologna Department of Biochemistry "G.Moruzzi" snail mail: Via Irnerio 48, 40126 Bologna, Italy email: [EMAIL PROTECTED] tel: +39-051-2094388 fax: +39-051-2094387 begin:vcard fn:Massimo Sandal n:Sandal;Massimo org:University of Bologna;Department of Biochemistry adr:;;Via Irnerio 48;Bologna;;40126;Italy email;internet:[EMAIL PROTECTED] tel;work:+39-051-2094388 tel;fax:+39-051-2094387 x-mozilla-html:FALSE version:2.1 end:vcard ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] [SciPy-user] linear_least_squares: OverFlow error
Hi, I upgraded today to latest numpy (0.9.8) and matplotlib (0.87.3). I still have the same error (upgraded code in snippet): - import matplotlib.numerix as nx contact_x_points=nx.array(x_points[left_bound:right_bound]) contact_y_points=nx.array(y_points[left_bound:right_bound]) A=nx.ones((len(contact_x_points),2)) A[:,0]=contact_x_points result=nx.linalg.lstsq(A,contact_y_points) - ...but when I run, it crashes with: >>result=nx.linalg.lstsq(A, contact_y_points) >> File "/usr/lib/python2.4/site-packages/numpy/linalg/linalg.py", line >> 457, in lstsq >>nlvl = max( 0, int( math.log( float(min( m,n ))/2. ) ) + 1 ) >> OverflowError: math range error any hint? m. -- Massimo Sandal University of Bologna Department of Biochemistry "G.Moruzzi" snail mail: Via Irnerio 48, 40126 Bologna, Italy email: [EMAIL PROTECTED] tel: +39-051-2094388 fax: +39-051-2094387 begin:vcard fn:Massimo Sandal n:Sandal;Massimo org:University of Bologna;Department of Biochemistry adr:;;Via Irnerio 48;Bologna;;40126;Italy email;internet:[EMAIL PROTECTED] tel;work:+39-051-2094388 tel;fax:+39-051-2094387 x-mozilla-html:FALSE version:2.1 end:vcard ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] OSError when exporting figure in EPS
Hi, I upgraded today to matplotlib 0.87.3, compiled from source. I noticed the following error when in my application I try to export the plot in EPS format. The odd thing is that the export actually works and produces a good eps file, but nevertheless... File "hooke.py", line 354, in ExportImage #that's my wxpython+MPL app self.figure.savefig(filename) File "/usr/lib/python2.4/site-packages/matplotlib/figure.py", line 660, in savefig self.canvas.print_figure(*args, **kwargs) File "/usr/lib/python2.4/site-packages/matplotlib/backends/backend_ps.py", line 1123, in print_figure else: shutil.move(tmpfile, outfile) File "/usr/lib/python2.4/shutil.py", line 193, in move copy2(src,dst) File "/usr/lib/python2.4/shutil.py", line 93, in copy2 copystat(src, dst) File "/usr/lib/python2.4/shutil.py", line 68, in copystat os.utime(dst, (st.st_atime, st.st_mtime)) OSError: [Errno 1] Operation not permitted: 'figura001.eps' Thanks as usual! Massimo -- Massimo Sandal University of Bologna Department of Biochemistry "G.Moruzzi" snail mail: Via Irnerio 48, 40126 Bologna, Italy email: [EMAIL PROTECTED] tel: +39-051-2094388 fax: +39-051-2094387 begin:vcard fn:Massimo Sandal n:Sandal;Massimo org:University of Bologna;Department of Biochemistry adr:;;Via Irnerio 48;Bologna;;40126;Italy email;internet:[EMAIL PROTECTED] tel;work:+39-051-2094388 tel;fax:+39-051-2094387 x-mozilla-html:FALSE version:2.1 end:vcard ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] pylab crashes simple wxPython script
Brian Blais ha scritto: I want to write a wxPython script to pull up pylab plots (in a separate window), based on menu or button choices. The script below crashes with a segmentation fault. Am I doing something wrong here? Is there a workaround or fix? As far as I know, mixing wxpython and pylab this way is BAD. You should better choose between: - (1)Launch pylab in a separate thread - (2) (What I do) Using WxMPL and embedding a matplotlib plot in a wxPanel or wxFrame. You have to use the OO interface to matplotlib. m. -- Massimo Sandal University of Bologna Department of Biochemistry "G.Moruzzi" snail mail: Via Irnerio 48, 40126 Bologna, Italy email: [EMAIL PROTECTED] tel: +39-051-2094388 fax: +39-051-2094387 begin:vcard fn:Massimo Sandal n:Sandal;Massimo org:University of Bologna;Department of Biochemistry adr:;;Via Irnerio 48;Bologna;;40126;Italy email;internet:[EMAIL PROTECTED] tel;work:+39-051-2094388 tel;fax:+39-051-2094387 x-mozilla-html:FALSE version:2.1 end:vcard ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] linear_least_squares: OverFlow error or flapack.error
Hi, I'm trying to do a simple linear least squares fit of some data in an application. The relevant code runs about as follows, following closely the example found on http://mail.python.org/pipermail/python-list/2006-March/331693.html - import matplotlib.numerix as nx contact_x_points=nx.array(x_points[left_bound:right_bound]) contact_y_points=nx.array(y_points[left_bound:right_bound]) A=nx.ones((len(contact_x_points),2)) A[:,0]=contact_x_points result=nx.linear_algebra.linear_least_squares(A,contact_y_points) - ...but when I run, it crashes with: File "hooke.py", line 202, in find_contact_point result=nx.linear_algebra.linear_least_squares(A,contact_y_points) File "/usr/lib/python2.3/site-packages/Numeric/LinearAlgebra.py", line 416, in linear_least_squares nlvl = max( 0, int( math.log( float(min( m,n ))/2. ) ) + 1 ) OverflowError: math range error I also tried using scipy: --- import scipy as sp contact_x_points=sp.array(x_points[left_bound:right_bound]) contact_y_points=sp.array(y_points[left_bound:right_bound]) A=sp.ones((len(contact_x_points),2)) A[:,0]=contact_x_points result=sp.linalg.lstsq(A,contact_y_points) - ... with another error: array_from_pyobj:intent(hide) must have defined dimensions. rank=1 dimensions=[ 0 ] Traceback: [...] File "hooke.py", line 202, in find_contact_point result=sp.linalg.lstsq(A, contact_y_points) File "/usr/lib/python2.3/site-packages/scipy/linalg/basic.py", line 344, in lstsq overwrite_b = overwrite_b) flapack.error: failed in converting hidden `s' of flapack.dgelss to C/Fortran array In my .matplotlibrc the numerix backend is Numeric. I'm on Debian Sarge; MPL version is 0.82 ; Scipy is 0.3.2 It must be noticed that I fail to declare A=nx.ones((len.contact_x_points),2),dtype=float) as the example should seem to require, because it gives me another error: TypeError: ones() got an unexpected keyword argument 'dtype' ...so if this is the problem, please tell me how to correctly pass the dtype argument. Since I'm quite a scipy/numeric newbie I guess there could be some obvious blunder and/or more correct way of obtaining my fit, and I'd be thankful to anyone pointing me at the solution... Thanks, Massimo -- Massimo Sandal University of Bologna Department of Biochemistry "G.Moruzzi" snail mail: Via Irnerio 48, 40126 Bologna, Italy email: [EMAIL PROTECTED] tel: +39-051-2094388 fax: +39-051-2094387 begin:vcard fn:Massimo Sandal n:Sandal;Massimo org:University of Bologna;Department of Biochemistry adr:;;Via Irnerio 48;Bologna;;40126;Italy email;internet:[EMAIL PROTECTED] tel;work:+39-051-2094388 tel;fax:+39-051-2094387 x-mozilla-html:FALSE version:2.1 end:vcard ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users