[Matplotlib-users] matplotlib ignores CocoaAgg backend in matplotlibrc
I have the CocoaAgg backend specified in matplotlibrc in ~/.matplotlib/ as: backend : CocoaAgg However, when I plot, matplotlib uses the TkAgg backend in spite of this. -- Christopher J. Fonnesbeck + Fish Wildlife Research Institute (FWC) + 727.235.5570 - 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
[Matplotlib-users] How to show matplotlib.image ?
The following run well . But I just want to make the image, with the x and y as axis and z as the image value ,show on the figure. In the pylab , we can just give a command imshow ,But here , I fail to do it , I have try ax.imshow() again and again ,but fail. Can sb give me some advice . Thank you . import matplotlib matplotlib.use(WXAgg) matplotlib.interactive(True) from matplotlib.backends.backend_wx import FigureCanvasWx from matplotlib.figure import Figure from matplotlib.axes import * from numpy import * import wx from pylab import * #--- class DynamicPlot(): def __init__(self,Frame): delta = 0.025 x = arange(-3.0, 3.0, delta) y = arange(-2.0, 2.0, delta) X, Y = meshgrid(x, y) Z1 = bivariate_normal(X, Y, 1.0, 1.0, 0.0, 0.0) Z2 = bivariate_normal(X, Y, 1.5, 0.5, 1, 1) Z = 10.0 * (Z2 - Z1) levels = arange(-1.2, 1.6, 0.2) self.fig = Figure((8,8), 75) self.canvas = FigureCanvasWx(Frame, -1, self.fig) ax=self.fig.add_axes([0.1,0.1,0.8,0.8]) ax.contour(X,Y,Z,levels,origin='lower',linewidths=2,extent=(-3,3,-2,2)) app = wx.PySimpleApp() f=wx.Frame(None,size=(600,600)) f.Show(True) DynamicPlot(f) app.MainLoop() -- View this message in context: http://www.nabble.com/How-to-show-matplotlib.image---tf4930297.html#a14111799 Sent from the matplotlib - users mailing list archive at Nabble.com. - 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
[Matplotlib-users] CocoaAgg backend status?
I was just wondering what the status of the CocoaAgg backend is since there is not much info available. Can it be used interactively w/ipython? Can it be used to embed mpl in a cocoa app and take advantage of all the xcode/interface builder stuff in OS X? Thanks- -stephen - 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] Matplotlib very slow
On Tuesday 04 December 2007 16:16:06 José Gómez-Dans wrote: On Tuesday 04 December 2007 16:05:33 John Hunter wrote: On Dec 4, 2007 10:00 AM, José Gómez-Dans [EMAIL PROTECTED] wrote: Hmm, the plot thickens. How about embedding_in_gtk2.py -- this add the toolbar This does indeed slow things down. The minimal script that reproduces this behaviour is the following (the delay appears round about the definition of toolbar): [...] Mmmm... I was just wondering whether compiling the new 0.91.1 version might make the problem go away? I am currently running 0.90.1. Thanks, J - 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] possible to expand the current Colorcycle?
On Dec 5, 2007 6:38 AM, Søren Nielsen [EMAIL PROTECTED] wrote: Hi, Is it possible to expand the colorcycle that matplotlib uses by default? in axes.py, class _process_plot_var_args, def _clear_color_cycle(self) It seems that self.colors are hardcoded to be self.colors = ['b','g','r','c','m','y','k'] ... is there a way to extend this? (Without changing the matplotlib code directly) I want to be able to extend it by ex. dashed lines or others.. i sometimes have a large number of plots to do, and the 7 default plot colors are not enough... I know I could manually make a handler in my program to handle the colors when I plot... but it would seem nicer if I could just pass a list of plot colors to matplotlib. I just made a chance in svn to expose the default color list. Here is an ipython session that shows how to use it: In [1]: import matplotlib.axes as mplaxes In [2]: x, y = rand(2,100) In [3]: plot(x, y, 2*x, 2*y) Out[3]: [matplotlib.lines.Line2D instance at 0x8f2dc8c, matplotlib.lines.Line2D instance at 0x8f2dd6c] In [4]: mplaxes._process_plot_var_args.defaultColors = ['red', 'darkslategray', 'wheat'] In [5]: clf() In [6]: plot(x, y, 2*x, 2*y) Darren, we might want to expose this in the matplotlib.conf, but perhaps is it a rare enough request that it is enough to let people tweak it manually when needed. The only thing that is a bit ugly is that Axes._process_plot_var_args has the leading underscore indicating it should not be used outside of mpl, but this is easy enough to remedy... JDH - 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] eggs or pythonmac packages on OS X?
On Dec 4, 2007 5:14 PM, Russell E. Owen [EMAIL PROTECTED] wrote: If you use Tcl/Tk and use a current version (instead of the ancient version that is built in) then use the packages at pythonmac. I just built 0.91.1 today and it should show up there soon. Meanwhile you can get it from here: http://www.astro.washington.edu/rowen/pythoninstallers/ I hope that someday the official Mac egg version will work with 3rd party Tcl/Tk but no version I've tried has -- including 0.91.1. Does this mean that the only difference between the egg and pythonmac version is how it's linked against Tcl/Tk? Just for my edification, why can't the egg version be linked against/include a different Tcl/Tk? Thanks- -stephen - 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] Matplotlib very slow
On Dec 5, 2007 8:58 AM, José Gómez-Dans [EMAIL PROTECTED] wrote: Mmmm... I was just wondering whether compiling the new 0.91.1 version might make the problem go away? I am currently running 0.90.1. Unlikely, we haven't changed anything in that code. One thing you can do, it is fairly labor intensive, is to paste the toolbar code from backend_gtk into your script and slowly start hacking away at it to see which gtk call is causing your problems. I don't see an easier way. Alternatively, you could get tkagg, qtagg or wxagg installed. If you want to stick with gtk, I can provide a sample script for you that defines the toolbar inline so you can hack on it. JDH - 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] matplotlib/__init__.py : gs version parsing problem
Xavier Gnata wrote: Hi, Quoting matplotlib/__init__.py : def checkdep_ghostscript(): try: if sys.platform == 'win32': command = 'gswin32c -v' else: command = 'gs -v' stdin, stdout = os.popen4(command) line = stdout.readlines()[0] v = line.split()[2] vtest = '.'.join(v.split('.')[:2]) # deal with version numbers like '7.07.1' float(vtest) return vtest except (IndexError, ValueError): return None It fails on debian sid because 'gs -v' returns GPL Ghostscript SVN PRE-RELEASE 8.61 (2007-08-02)\n Anyway, the parser will be ugly because it has to deal with version numbers like '7.07.1'. Should I propose a trivial patch to get thinks working on debian sid ? Xavier ps :Why is there no standard way (like -v or --version) on *unix to get the version *number*?? Only the version number. Why :( -- Xavier Gnata CRAL - Observatoire de Lyon 9, avenue Charles André 69561 Saint Genis Laval cedex Phone: +33 4 78 86 85 28 Fax: +33 4 78 86 83 86 E-mail: [EMAIL PROTECTED] - 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 Yeah , I did face the same problem . My code is following: There seems to be something wrong in ax.imshow(im), I can't get the answer , Can sb help me . The error messageValueError: need more than 0 values to unpack Thank you . # -*- coding:gb2312 -*- import wx from pylab import * from matplotlib.backends.backend_wx import FigureCanvasWx from matplotlib.figure import Figure from matplotlib.axes import * from numpy import * #- x=array(range(0,100)) y=array(range(0,100)) z=rand(100,100) figure(1) im=imshow(z, interpolation='bilinear', origin='lower',cmap=cm.gray, extent=(0,100,0,100)) levels = arange(0.3, 0.4, 0.9) contour(x,y,z,levels,origin='lower',linewidths=2,extent=(0,100,0,100)) fig=figure(2) ax = fig.add_subplot(111) ax.imshow(im) ax.set_xlim(0,3) ax.set_ylim(0,2) show() -- View this message in context: http://www.nabble.com/matplotlib-__init__.py-%3A-gs-version-parsing-problem-tf4821980.html#a14114656 Sent from the matplotlib - users mailing list archive at Nabble.com. - 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] How to show matplotlib.image ?
John Hunter wrote: You cannot import pylab and use the FigureCanvasWx at the same time. Please follow the lead of examples/embedding_in_wx*.py if you want to use matplotlib in a wxpython GUI. or use wxmpl: http://agni.phys.iit.edu/~kmcivor/wxmpl/ By the way, couldn't that be distributed with Matplotlib? Maybe in toolkits, if not the main distro. -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/ORR(206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception [EMAIL PROTECTED] - 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] ImportError: cannot import name rcParams
On Dec 2, 2007 1:04 AM, Brian Orr [EMAIL PROTECTED] wrote: Hi All, I'm running into the following error when I try to run any of the matplotlib examples: $ python anim.py Traceback (most recent call last): File anim.py, line 19, in module import pylab as p File C:\Python25\Lib\site-packages\pylab.py, line 1, in module from matplotlib.pylab import * File C:\Python25\Lib\site-packages\matplotlib\pylab.py, line 206, in module from matplotlib.numerix import npyma as ma File C:\Python25\Lib\site-packages\matplotlib\numerix\__init__.py, line 20, in module from matplotlib import rcParams, verbose ImportError: cannot import name rcParams I'm using the latest versions of matplotlib and numpy, ActivePython 2.5 (all for Windows XP). Any help would be appreciated. There was a bug in our windows installer. Please remove the old mpl install, grab the latest installer from the download site, and try again. Sorry for the trouble! Thanks, JDH - 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] TypeError on CocoaAgg backend
Chris, I appologize for cryptic language and quickly written emails leading you astray. I've included the diff of backend_cocoaagg.py (which has also been sent to the mpl devs) which seems to work for me. Barry backend_cocoaagg.py.diff Description: Binary data On Dec 3, 2007, at 8:00 PM, Chris Fonnesbeck wrote: On Dec 3, 2007 7:34 PM, Barry Wark [EMAIL PROTECTED] wrote: sorry instances of self.plotView.image On Dec 3, 2007 3:38 PM, Chris Fonnesbeck [EMAIL PROTECTED] wrote: I replaced the one instance of this that I found. I now get the following error: In [7]: show() --- ValueErrorTraceback (most recent call last) /Users/chris/ipython console in module() /Library/Python/2.5/site-packages/matplotlib/backends/ backend_cocoaagg.py in show() 44 def show(): 45 for manager in Gcf.get_all_fig_managers(): --- 46 manager.show() 47 48 def draw_if_interactive(): /Library/Python/2.5/site-packages/matplotlib/backends/ backend_cocoaagg.py in show(self) 203 mplBundle, 204 False) -- 205 NSApplication.sharedApplication().run() 206 207 ValueError: NSInvalidArgumentException - NSImageCell's object value must be an NSImage. -- Christopher J. Fonnesbeck + Fish Wildlife Research Institute (FWC) + 727.235.5570 - 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] number rendering in GTKCairo
It works for me on Linux with matplotlib 0.91.1, and Cairo 1.4.0. What version of matplotlib and Cairo are you using? It sounds like it may be pulling in the wrong fonts. Can you please send the contents of your matplotlibrc file, and also set verbose.level to debug-annoying and send the output? Cheers, Mike Brian Baughman wrote: Hello all, I am trying to get a setup where I can have an interactive environment and output to PDF files as needed. I currently have this setup working in OS X 10.5 without problems. However, I cannot get a similar setup working on linux. The best I have been able to do is by using GTKCairo but it has a problem with rendering numbers in math mode. Specifically when I put a number, say -3.1415, into a string the decimal is converted to a : and the - is turned into an i. Below is an example that gives this error: import numpy from pylab import * x = numpy.arange(1,100,1) e1=-1.8 e2=-2.1 y = x**2 z = x**-2 f = figure(num=1) f.clear() ax = f.add_subplot(111) p = ax.plot(x,y) p1 = ax.plot(x,z) title('This works -2.1 but this doesnot $-2.1$') legend((p[0],p1[0]),(r'$x^{%.2g}$'%(e1),r'$x^{%.2g}$'%(e2))) draw() savefig('test.pdf') The output looks fine in GTKAgg but then I get an error on glib. Anyone have any ideas on how to get it working? Regards, Brian - 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 -- Michael Droettboom Science Software Branch Operations and Engineering Division Space Telescope Science Institute Operated by AURA for NASA - 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
[Matplotlib-users] filehandle leaks in matplotlib 0.91.1
hi, I think the new 0.91.1 has some kind of file handle leak at least when using python 2.4, tkagg, and within ipython. Using process explorer to look at filehandles opened by python then I get about 25 new open handles to vera.ttf per %run of the following script. from pylab import * figure(1) clf() title(jj) figure(2) clf() title(jj) However if I close(all) between %runs then all the open handles are closed. I tried the same thing with 0.90.1 and then I only get 2 handles for the same script and no increase on subsequent calls with or without close(all). /Jörgen - 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] CocoaAgg backend status?
Thanks for the background Barry. I was asking because I have a bit of image processing/analysis code (numpy/mpl/pil) that I would like to build a GUI front-end for. As I am a recent convert to the osx world, I thought it would be very slick to be able to do this with the xcode/IB tools. Since this is not high-priority work right now, I'll stick with wx for now. I will be interested to see how your Quartz backend comes along. - 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] eggs or pythonmac packages on OS X?
I primarily follow the dev list, but you've caught my eye. ;) So to be clear, you would just like me to install some other tcl/tk before I do the official matplotlib osx binaries. What package should I be installing and where should I get it from. As long as it still works with the bundled tck/tk I would have no problems doing this. Thanks, - Charlie On Dec 5, 2007 12:01 PM, Russell E Owen [EMAIL PROTECTED] wrote: At 10:08 AM -0500 2007-12-05, Stephen Uhlhorn wrote: On Dec 4, 2007 5:14 PM, Russell E. Owen [EMAIL PROTECTED] wrote: If you use Tcl/Tk and use a current version (instead of the ancient version that is built in) then use the packages at pythonmac. I just built 0.91.1 today and it should show up there soon. Meanwhile you can get it from here: http://www.astro.washington.edu/rowen/pythoninstallers/ I hope that someday the official Mac egg version will work with 3rd party Tcl/Tk but no version I've tried has -- including 0.91.1. Does this mean that the only difference between the egg and pythonmac version is how it's linked against Tcl/Tk? I suspect you are right. But I only build the pythonmac version, not the official version, so I don't know for sure. I build my version using: http://www.astro.washington.edu/rowen/BuildingMatplotlibForMac.html. I don't do anything special, but I do have a 3rd party Tcl/Tk installed before I build and that seems to make all the difference. Just for my edification, why can't the egg version be linked against/include a different Tcl/Tk? If you mean why can't it be built that way in the first place, I don't know. The guy who builds it apparently doesn't read this list, and I understand he's on some mailing list that I don't subscribe to. I suspect the official egg can somehow be patched, but I find it easier to just build my own and put that on pythonmac. -- Russell - 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 - 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
I feel we're getting a tad bit off topic from my original inquiry. Does anyone have an answer for me? Thanks. On Dec 5, 2007 8:42 AM, massimo sandal [EMAIL PROTECTED] wrote: 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-harmfulhttp://woozle.org/%7Eneale/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 - 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 - 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
[Matplotlib-users] matplotlib install
i am having trouble installing matplotlib from source and thought i would post my issue here. i download matplotlib version 0.91.0 i am using a version of scientific linux, so i can't use rpm packages for some packages # uname -a Linux labcalx 2.6.23.8 #1 Fri Nov 23 10:54:41 EST 2007 i686 i686 i386 GNU/Linux i verified that i had the following packages installed via rpm: matplotlib core: zlib, zlib-devel, libpng, libpng-devel, freetype, freetype-devel, freetype-utils • gtk backend: gtk2-devel, gtk+-devel, pygtk2, glib-devel, pygtk2-devel, gnome-libs-devel, pygtk2-libglade • tk backend: tcl, tk, tkinter (and tk-devel) the wxpython package is not available on rpm for me (at least not that i can find) so i downloaded the source. that also seemed to compile and install fine. the libraries are in /usr/local/lib and that path is referenced in file /etc/ld.so.conf.d/wx.conf the ldconfig command seemed to find this okay and that looks like it should work. as per the user install guide, i downloaded setuptools-0.6c7-py2.3.egg without any trouble here is my output from the build command: # python setup.py build BUILDING MATPLOTLIB matplotlib: 0.91.0 python: 2.3.4 (#1, Oct 9 2006, 18:22:22) [GCC 3.4.5 20051201 (Red Hat 3.4.5-2)] platform: linux2 REQUIRED DEPENDENCIES numpy: 0.9.8 freetype2: 9.7.3 OPTIONAL BACKEND DEPENDENCIES libpng: 1.2.7 Tkinter: Tkinter: 1.177, Tk: 8.4, Tcl: 8.4 wxPython: no * wxPython not found Gtk+: gtk+: 2.4.13, glib: 2.4.7, pygtk: 2.4.0, pygobject: [pre-pygobject] Qt: no Qt4: no Cairo: no OPTIONAL DATE/TIMEZONE DEPENDENCIES datetime: present, version unknown dateutil: matplotlib will provide pytz: matplotlib will provide OPTIONAL USETEX DEPENDENCIES dvipng: no ghostscript: 7.07 latex: 3.14159 pdftops: 3.00 EXPERIMENTAL CONFIG PACKAGE DEPENDENCIES configobj: matplotlib will provide enthought.traits: matplotlib will provide [Edit setup.cfg to suppress the above messages] running build running build_py copying lib/matplotlib/mpl-data/matplotlibrc - build/lib.linux-i686-2.3/matplotlib/mpl-data copying lib/matplotlib/mpl-data/matplotlib.conf - build/lib.linux-i686-2.3/matplotlib/mpl-data running build_ext building 'matplotlib.backends._backend_agg' extension g++4 options: '-fno-strict-aliasing -DNDEBUG -O2 -g -pipe -m32 -march=i386 -mtune=pentium4 -D_GNU_SOURCE -fPIC -fPIC' creating build/temp.linux-i686-2.3 creating build/temp.linux-i686-2.3/agg23 creating build/temp.linux-i686-2.3/agg23/src creating build/temp.linux-i686-2.3/src creating build/temp.linux-i686-2.3/CXX compile options: '-I/usr/lib/python2.3/site-packages/numpy/core/include -I/usr/include/libpng12 -I/usr/local/include -I/usr/include -I. -Isrc -Iswig -Iagg23/include -I. -I/usr/include/freetype2 -I/usr/local/include -I/usr/include -I. -I/usr/include/python2.3 -c' g++4: src/_image.cpp In file included from /usr/include/python2.3/Python.h:8, from src/_image.cpp:7: /usr/include/python2.3/pyconfig.h:850:1: warning: _POSIX_C_SOURCE redefined In file included from /usr/include/c++/3.4.3/i386-redhat-linux/bits/os_defines.h:39, from /usr/include/c++/3.4.3/i386-redhat-linux/bits/c++config.h:35, from /usr/include/c++/3.4.3/iostream:44, from src/_image.cpp:1: /usr/include/features.h:150:1: warning: this is the location of the previous definition g++4: agg23/src/agg_rasterizer_scanline_aa.cpp g++4: CXX/IndirectPythonInterface.cxx In file included from /usr/include/python2.3/Python.h:8, from ./CXX/WrapPython.h:47, from ./CXX/IndirectPythonInterface.hxx:41, from CXX/IndirectPythonInterface.cxx:38: /usr/include/python2.3/pyconfig.h:850:1: warning: _POSIX_C_SOURCE redefined In file included from /usr/include/sys/time.h:22, from ./CXX/WrapPython.h:43, from ./CXX/IndirectPythonInterface.hxx:41, from CXX/IndirectPythonInterface.cxx:38: /usr/include/features.h:150:1: warning: this is the location of the previous definition g++4: src/backend_agg.cpp In file included from /usr/include/python2.3/Python.h:8, from ./CXX/WrapPython.h:47, from ./CXX/Extensions.hxx:48, from src/ft2font.h:18, from src/backend_agg.cpp:24: /usr/include/python2.3/pyconfig.h:850:1: warning: _POSIX_C_SOURCE redefined In file included from /usr/include/c++/3.4.3/i386-redhat-linux/bits/os_defines.h:39, from /usr/include/c++/3.4.3/i386-redhat-linux/bits/c++config.h:35, from /usr/include/c++/3.4.3/iostream:44, from src/backend_agg.cpp:4: /usr/include/features.h:150:1: warning: this is the location of the previous definition /usr/lib/python2.3/site-packages/numpy/core/include/numpy/ufuncobject.h:9: error: 'intp' has not been declared /usr/lib/python2.3/site-packages/numpy/core/include/numpy/ufuncobject.h:9: error: 'intp' has not been declared In file included from /usr/include/python2.3/Python.h:8, from ./CXX/WrapPython.h:47, from ./CXX/Extensions.hxx:48, from src/ft2font.h:18, from
Re: [Matplotlib-users] CocoaAgg backend status?
On Dec 5, 2007 11:55 AM, Barry Wark [EMAIL PROTECTED] wrote: Stephen, The CocoaAgg backend is not supported in IPython. Though we'd love to support it, were a few patches to land our way :) Cheers, f - 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] CocoaAgg backend status?
Stephen, The CocoaAgg backend is not supported in IPython. You can use it in the non-interactive form (i.e. with a pylab.show() but you will have to close the window in order to return control to the IPython shell). It is possible to embed an MPL plot in a Cocoa application using the same trick as the CocoaAgg backend (rendering the plot using the Agg backend and then turning the rasterized bitmap into and NSBitmapImageRep and then displaying it in an NSImageView). I've posted previously about a py2app plugin which does just that and has an IB palette, but I haven't had time to update the IB palette to use the IB 3 plugin API yet. It uses Cocoa Bindings to provide data to the plot. I'm happy to send it to you as is, or you can wait until it's IB 3 ready. We (at my work) are just starting to think about writing a more direct Quartz backend for mpl. A native backend would let a matplotlib view participate in newer Cocoa technologies, such as resolution independence and CoreAnimation (it's possible with the current backend method, but not quite as flexible). This will make embedding easier, but will not solve the IPython issues. For now, one of the other backends, such as WXAgg or TkAgg is probably the better bet on OS X. barry On Dec 5, 2007, at 7:37 AM, Stephen Uhlhorn wrote: I was just wondering what the status of the CocoaAgg backend is since there is not much info available. Can it be used interactively w/ipython? Can it be used to embed mpl in a cocoa app and take advantage of all the xcode/interface builder stuff in OS X? Thanks- -stephen - 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 [EMAIL PROTECTED] - 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] CocoaAgg backend status?
Barry Wark wrote: We (at my work) are just starting to think about writing a more direct Quartz backend for mpl. A native backend would let a matplotlib view participate in newer Cocoa technologies, such as resolution independence and CoreAnimation (it's possible with the current backend method, but not quite as flexible). I'm curious what Cocoa and CoreAnimation might enable... If you are looking into writing a Quartz rendering backend, you may want to start with the matplotlib transforms branch (which should become the trunk shortly, once the 0.91 release bugs get shaken out.) The number of methods that a backend writer must provide has been greatly reduced on that branch. Cheers, Mike -- Michael Droettboom Science Software Branch Operations and Engineering Division Space Telescope Science Institute Operated by AURA for NASA - 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] eggs or pythonmac packages on OS X?
Russell E Owen wrote: At 10:08 AM -0500 2007-12-05, Stephen Uhlhorn wrote: Just for my edification, why can't the egg version be linked against/include a different Tcl/Tk? If you mean why can't it be built that way in the first place, I don't know. The guy who builds it apparently doesn't read this list, Sure he does (if you mean the matplotlib list), and he did ask about it right before this release. Maybe that was asked on matplotlib-devel though (I filter them to the same place). I suspect the official egg can somehow be patched, but I find it easier to just build my own and put that on pythonmac. Ideally, there would be only one binary version, and it would work with either Tcl/Tk. Is that possible? or is this like the old wx situation, where it can only be run with the same version it is built against. Arrggg! I hope not. If there really do need to be two, then they should be labeled somehow, and both be up on python mac. -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/ORR(206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception [EMAIL PROTECTED] - 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] filehandle leaks in matplotlib 0.91.1
I'm on a Linux box (I'm assuming you're on Windows, since you mentioned Process Explorer), and I wasn't able to find any file handle leaks, as such, but I did see that font files were being opened many more times than they need to be. If you're able to run from Subversion, r4633 has a fix for this. I'm curious if it fixes your symptoms. Cheers, Mike Jörgen Stenarson wrote: hi, I think the new 0.91.1 has some kind of file handle leak at least when using python 2.4, tkagg, and within ipython. Using process explorer to look at filehandles opened by python then I get about 25 new open handles to vera.ttf per %run of the following script. from pylab import * figure(1) clf() title(jj) figure(2) clf() title(jj) However if I close(all) between %runs then all the open handles are closed. I tried the same thing with 0.90.1 and then I only get 2 handles for the same script and no increase on subsequent calls with or without close(all). /Jörgen - 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 -- Michael Droettboom Science Software Branch Operations and Engineering Division Space Telescope Science Institute Operated by AURA for NASA - 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] number rendering in GTKCairo
What's happening is that it isn't finding the Bakoma Computer Modern fonts. These have a non-standard encoding, so the '-' for instance, is actually under a different character code. So... we need to track down why it's looking in the wrong place. Can you send the output of: python Python 2.5.1 (r251:54863, Jul 2 2007, 08:53:40) [GCC 3.4.6 20060404 (Red Hat 3.4.6-8)] on linux2 Type help, copyright, credits or license for more information. import matplotlib matplotlib.__file__ '/home/mdroe/usr/lib/python2.5/site-packages/matplotlib/__init__.pyc' matplotlib.__version__ '0.91.2.svn' matplotlib._get_data_path() '/home/mdroe/usr/lib/python2.5/site-packages/matplotlib/mpl-data' You may also try deleting your font cache in ~/.matplotlib/fontManager.cache Cheers, Mike Brian Baughman wrote: Hello, I am using matplotlib svn 4626 and Cairo 1.4.0 all with python 2.5 with Ubuntu linux 7.10. The only lines in my matplotlibrc file which are uncommented are: backend : GTKCairo numerix : numpy # numpy, Numeric or numarray interactive : True # see http://matplotlib.sourceforge.net/interactive.html verbose.level : debug-annoying # one of silent, helpful, debug, debug-annoying Below is the output of the script I submitted when debug-annoying is turned on: In [3]: x = numpy.arange(1,100,1) In [4]: e1=-1.8 In [5]: e2=-2.1 In [6]: y = x**2 In [7]: z = x**-2 In [8]: f = figure(num=1) In [9]: f.clear() In [10]: ax = f.add_subplot(111) In [11]: p = ax.plot(x,y) In [12]: p1 = ax.plot(x,z) In [13]: title('This works -2.1 but this doesnot $-2.1$') findfont found Bitstream Vera Sans, normal, normal 400, normal, 12.0 findfont returning /usr/lib/python2.4/site-packages/matplotlib/mpl-data/fonts/ttf/Vera.ttf findfont found Bitstream Vera Sans, normal, normal 400, normal, 12.0 findfont returning /usr/lib/python2.4/site-packages/matplotlib/mpl-data/fonts/ttf/Vera.ttf findfont found Bitstream Vera Sans, normal, normal 400, normal, 12.0 findfont returning /usr/lib/python2.4/site-packages/matplotlib/mpl-data/fonts/ttf/Vera.ttf findfont found Bitstream Vera Sans, normal, normal 400, normal, 12.0 findfont returning /usr/lib/python2.4/site-packages/matplotlib/mpl-data/fonts/ttf/Vera.ttf findfont found Bitstream Vera Sans, normal, normal 400, normal, 12.0 findfont returning /usr/lib/python2.4/site-packages/matplotlib/mpl-data/fonts/ttf/Vera.ttf findfont found Bitstream Vera Sans, normal, normal 400, normal, 12.0 findfont returning /usr/lib/python2.4/site-packages/matplotlib/mpl-data/fonts/ttf/Vera.ttf findfont found Bitstream Vera Sans, normal, normal 400, normal, 12.0 findfont returning /usr/lib/python2.4/site-packages/matplotlib/mpl-data/fonts/ttf/Vera.ttf findfont found Bitstream Vera Sans, normal, normal 400, normal, 12.0 findfont returning /usr/lib/python2.4/site-packages/matplotlib/mpl-data/fonts/ttf/Vera.ttf findfont found Bitstream Vera Sans, normal, normal 400, normal, 12.0 findfont returning /usr/lib/python2.4/site-packages/matplotlib/mpl-data/fonts/ttf/Vera.ttf findfont found Bitstream Vera Sans, normal, normal 400, normal, 12.0 findfont returning /usr/lib/python2.4/site-packages/matplotlib/mpl-data/fonts/ttf/Vera.ttf findfont found Bitstream Vera Sans, normal, normal 400, normal, 12.0 findfont returning /usr/lib/python2.4/site-packages/matplotlib/mpl-data/fonts/ttf/Vera.ttf findfont found Bitstream Vera Sans, normal, normal 400, normal, 12.0 findfont returning /usr/lib/python2.4/site-packages/matplotlib/mpl-data/fonts/ttf/Vera.ttf findfont found Bitstream Vera Sans, normal, normal 400, normal, 12.0 findfont returning /usr/lib/python2.4/site-packages/matplotlib/mpl-data/fonts/ttf/Vera.ttf findfont found Bitstream Vera Sans, normal, normal 400, normal, 12.0 findfont returning /usr/lib/python2.4/site-packages/matplotlib/mpl-data/fonts/ttf/Vera.ttf findfont found Bitstream Vera Sans, normal, normal 400, normal, 12.0 findfont returning /usr/lib/python2.4/site-packages/matplotlib/mpl-data/fonts/ttf/Vera.ttf findfont found Bitstream Vera Sans, normal, normal 400, normal, 12.0 findfont returning /usr/lib/python2.4/site-packages/matplotlib/mpl-data/fonts/ttf/Vera.ttf findfont found Bitstream Vera Sans, normal, normal 400, normal, 12.0 findfont returning /usr/lib/python2.4/site-packages/matplotlib/mpl-data/fonts/ttf/Vera.ttf findfont found Bitstream Vera Sans, normal, normal 400, normal, 12.0 findfont returning /usr/lib/python2.4/site-packages/matplotlib/mpl-data/fonts/ttf/Vera.ttf findfont found Bitstream Vera Sans, normal, normal 400, normal, 12.0 findfont returning /usr/lib/python2.4/site-packages/matplotlib/mpl-data/fonts/ttf/Vera.ttf findfont found Bitstream Vera Sans, normal, normal 400, normal, 12.0 findfont returning
[Matplotlib-users] converting GMT color palettes to pylab colormaps
Does anyone here have any experience converting GMT color palettes into pylab colormaps? I took a stab at it, and the results are not really what I expected. GMT, for the unfamiliar, is a scientific plotting/mapping package that I'm doing my best to rid myself of. If you've never heard of it, then you can probably ignore this message. Here's my attempt at bringing in a GMT color palette: #!/usr/bin/python from pylab import * #GMT color palette - Colors are specified by a RGB triplet with each value in the range #0-255. The palette below specifies that a data value between 1 and 2 will be assigned a color #linearly interpreted between the colors (255,255,255) and (191,204,255). # 0 255 255 255 1 255 255 255 # 1 255 255 255 2 191 204 255 # 2 191 204 255 3 160 230 255 # 3 160 230 255 4 128 255 255 # 4 128 255 255 5 122 255 147 # 5 122 255 147 6 255 255 0 # 6 255 255 0 7 255 200 0 # 7 255 200 0 8 255 145 0 # 8 255 145 0 9 255 0 0 # 9 255 0 0 10 200 0 0 # 10 200 0 0 13 128 0 0 cdict = {'red': ((0.0,1.00,1.0), (0.1,1.00,0.75), (0.2,0.75,0.63), (0.3,0.63,0.50), (0.4,0.50,0.48), (0.5,0.48,1.00), (0.6,1.00,1.00), (0.7,1.00,1.00), (0.8,1.00,1.00), (0.9,1.00,0.78), (1.0,0.78,0.50)), 'green': ((0.0,1.00,1.00), (0.1,1.00,0.80), (0.2,0.80,0.90), (0.3,0.90,1.00), (0.4,1.00,1.00), (0.5,1.00,1.00), (0.6,1.00,0.78), (0.7,0.78,0.57), (0.8,0.57,0.00), (0.9,0.00,0.00), (1.0,0.00,0.00)), 'blue': ((0.0,1.00,1.00), (0.1,1.00,1.00), (0.2,1.00,1.00), (0.3,1.00,1.00), (0.4,1.00,0.58), (0.5,0.58,0.00), (0.6,0.00,0.00), (0.7,0.00,0.00), (0.8,0.00,0.00), (0.9,0.00,0.00), (1.0,0.00,0.00))} my_cmap = matplotlib.colors.LinearSegmentedColormap('my_colormap',cdict) pcolor(rand(10,10),cmap=my_cmap) colorbar() savefig('colormap.png') -- Michael Hearne [EMAIL PROTECTED] (303) 273-8620 USGS National Earthquake Information Center 1711 Illinois St. Golden CO 80401 Senior Software Engineer Synergetics, Inc. -- - 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] number rendering in GTKCairo
Hello, Below is the requested output which looks correct to me: [EMAIL PROTECTED]:~/dev/pyanalysis$ python Python 2.5.1 (r251:54863, Oct 5 2007, 13:36:32) [GCC 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)] on linux2 Type help, copyright, credits or license for more information. import matplotlib matplotlib.__file__ '/usr/lib/python2.5/site-packages/matplotlib/__init__.pyc' matplotlib.__version__ '0.91.2svn' matplotlib._get_data_path() '/usr/lib/python2.5/site-packages/matplotlib/mpl-data' Deleting the ~/.matplotlib/fontManager.cache did not change the behavior. Thanks for all the help. I really like using matplotlib on my Mac but it doesn't have the power that my Ubuntu box has. Regards, Brian On Dec 5, 2007, at 2:52 PM, Michael Droettboom wrote: What's happening is that it isn't finding the Bakoma Computer Modern fonts. These have a non-standard encoding, so the '-' for instance, is actually under a different character code. So... we need to track down why it's looking in the wrong place. Can you send the output of: python Python 2.5.1 (r251:54863, Jul 2 2007, 08:53:40) [GCC 3.4.6 20060404 (Red Hat 3.4.6-8)] on linux2 Type help, copyright, credits or license for more information. import matplotlib matplotlib.__file__ '/home/mdroe/usr/lib/python2.5/site-packages/matplotlib/__init__.pyc' matplotlib.__version__ '0.91.2.svn' matplotlib._get_data_path() '/home/mdroe/usr/lib/python2.5/site-packages/matplotlib/mpl-data' You may also try deleting your font cache in ~/.matplotlib/ fontManager.cache Cheers, Mike - 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
[Matplotlib-users] rcparams problem with pylab
Hi. I installed matplotlib and get the following when I import pylab: In [8]: import pylab --- ImportError Traceback (most recent call last) C:\Documents and Settings\luke\Desktop\ipython console in module() C:\Python25\Lib\site-packages\pylab.py in module() 1 from matplotlib.pylab import * 2 import matplotlib.pylab 3 __doc__ = matplotlib.pylab.__doc__ C:\Python25\Lib\site-packages\matplotlib\pylab.py in module() 204 # replace the present numpy.ma implementation in a future 205 # numpy release. -- 206 from matplotlib.numerix import npyma as ma 207 208 from matplotlib import mpl # pulls in most modules C:\Python25\Lib\site-packages\matplotlib\numerix\__init__.py in module() 18 19 import sys, os, struct --- 20 from matplotlib import rcParams, verbose 21 22 which = None, None ImportError: cannot import name rcParams Any ideas? I searched and found one hit, but no solution... -- View this message in context: http://www.nabble.com/rcparams-problem-with-pylab-tf4930220.html#a14111560 Sent from the matplotlib - users mailing list archive at Nabble.com. - 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
[Matplotlib-users] number rendering in GTKCairo
Hello all, I am trying to get a setup where I can have an interactive environment and output to PDF files as needed. I currently have this setup working in OS X 10.5 without problems. However, I cannot get a similar setup working on linux. The best I have been able to do is by using GTKCairo but it has a problem with rendering numbers in math mode. Specifically when I put a number, say -3.1415, into a string the decimal is converted to a : and the - is turned into an i. Below is an example that gives this error: import numpy from pylab import * x = numpy.arange(1,100,1) e1=-1.8 e2=-2.1 y = x**2 z = x**-2 f = figure(num=1) f.clear() ax = f.add_subplot(111) p = ax.plot(x,y) p1 = ax.plot(x,z) title('This works -2.1 but this doesnot $-2.1$') legend((p[0],p1[0]),(r'$x^{%.2g}$'%(e1),r'$x^{%.2g}$'%(e2))) draw() savefig('test.pdf') The output looks fine in GTKAgg but then I get an error on glib. Anyone have any ideas on how to get it working? Regards, Brian - 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] eggs or pythonmac packages on OS X?
I feel a 0.91.2 in the next few weeks, and I'll be sure to do this and send you a test build. - Charlie On Dec 5, 2007 1:30 PM, Russell E Owen [EMAIL PROTECTED] wrote: At 10:03 AM -0800 2007-12-05, Christopher Barker wrote: Russell E Owen wrote: At 10:08 AM -0500 2007-12-05, Stephen Uhlhorn wrote: Just for my edification, why can't the egg version be linked against/include a different Tcl/Tk? If you mean why can't it be built that way in the first place, I don't know. The guy who builds it apparently doesn't read this list, Sure he does (if you mean the matplotlib list), and he did ask about it right before this release. Maybe that was asked on matplotlib-devel though (I filter them to the same place). It was on matploblib-devel. I'll start skimming that newsgroup. I suspect the official egg can somehow be patched, but I find it easier to just build my own and put that on pythonmac. Ideally, there would be only one binary version, and it would work with either Tcl/Tk. Is that possible? or is this like the old wx situation, where it can only be run with the same version it is built against. Arrggg! I hope not. The version I build *can* be used with the built in Tcl/Tk. The version Charlie Moad builds cannot be used with TkAgg and a 3rd party Tcl/Tk -- it not only won't use the library, but it also acts flaky. Older versions crashed. 0.91.1 doesn't crash, but import of pylab fails with a traceback. For some reason it seems to be necessary to have a 3rd party Tcl/Tk installed when building matplotlib. It seems a shame. Tkinter in Python 2.4 was the same way, but that got fixed in Python 2.5 (I don't whether the installer got fixed or whether whoever builds Mac Python 2.5 installed a 3rd party Tcl/Tk). If there really do need to be two, then they should be labeled somehow, and both be up on python mac. Since there don't need to be two versions this is not necessary. However, Charlie Moad appears to be willing to start building a version that works with 3rd party Tcl/Tk. I really hope that happens. -- Russell - 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 - 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] number rendering in GTKCairo
Hello, On the Mac I use TkAgg and can output PDF files no problem. The only reason I was using GTKCairo was to get the PDF output which was not working with GTKAgg. I just updated to the most recent SVN from the one I was using from earlier today and now I can save to PDF in GTKAgg without troubles. Basically I just wanted something that was interactive till I made the plot to my liking then I could save the figure to a PDF. On the mac this worked with TkAgg without any troubles and now on Linux it works iwth GTKAgg without any troubles. Not sure what changed but thanks for the help. Regards, Brian On Dec 5, 2007, at 4:01 PM, Michael Droettboom wrote: Sorry for the wild goose chase. Now that my memory has been jogged -- This is actually a known problem with the Cairo backend. Cairo only allows access to fonts installed in the normal OS-specific places (and /usr/lib/python2.5/site-packages/matplotlib/mpl-data/ fonts/ttf is definitely not one of them... ;) Worse than that, AFAIK, there is know way of knowing whether a particular font was found, so we can't give users a nice warning message when your situation occurs. To remedy: Install all of the matplotlib fonts into a standard place where fontconfig will find them (such as ~/.fonts). Then run fc-cache to regenerate the font cache. Matplotlib's Cairo backend should hopefully work after that. You can also use the regular PDF backend, which doesn't exhibit this problem. If there's a reason why the Cairo PDF output is better than the normal PDF backend's output for you, please let us know. What I'm puzzled by now is -- why did the Cairo backend work for you on the Mac? Did you install the fonts there? I'm not on the Mac much --- but I'd be very surprised if Cairo found the CM fonts as installed by matplotlib automagically there. Cheers, Mike Brian Baughman wrote: Hello, Below is the requested output which looks correct to me: [EMAIL PROTECTED]:~/dev/pyanalysis$ python Python 2.5.1 (r251:54863, Oct 5 2007, 13:36:32) [GCC 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)] on linux2 Type help, copyright, credits or license for more information. import matplotlib matplotlib.__file__ '/usr/lib/python2.5/site-packages/matplotlib/__init__.pyc' matplotlib.__version__ '0.91.2svn' matplotlib._get_data_path() '/usr/lib/python2.5/site-packages/matplotlib/mpl-data' Deleting the ~/.matplotlib/fontManager.cache did not change the behavior. Thanks for all the help. I really like using matplotlib on my Mac but it doesn't have the power that my Ubuntu box has. Regards, Brian On Dec 5, 2007, at 2:52 PM, Michael Droettboom wrote: What's happening is that it isn't finding the Bakoma Computer Modern fonts. These have a non-standard encoding, so the '-' for instance, is actually under a different character code. So... we need to track down why it's looking in the wrong place. Can you send the output of: python Python 2.5.1 (r251:54863, Jul 2 2007, 08:53:40) [GCC 3.4.6 20060404 (Red Hat 3.4.6-8)] on linux2 Type help, copyright, credits or license for more information. import matplotlib matplotlib.__file__ '/home/mdroe/usr/lib/python2.5/site-packages/matplotlib/ __init__.pyc' matplotlib.__version__ '0.91.2.svn' matplotlib._get_data_path() '/home/mdroe/usr/lib/python2.5/site-packages/matplotlib/mpl-data' You may also try deleting your font cache in ~/.matplotlib/ fontManager.cache Cheers, Mike -- Michael Droettboom Science Software Branch Operations and Engineering Division Space Telescope Science Institute Operated by AURA for NASA - 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
[Matplotlib-users] possible to expand the current Colorcycle?
Hi, Is it possible to expand the colorcycle that matplotlib uses by default? in axes.py, class _process_plot_var_args, def _clear_color_cycle(self) It seems that self.colors are hardcoded to be self.colors = ['b','g','r','c','m','y','k'] ... is there a way to extend this? (Without changing the matplotlib code directly) I want to be able to extend it by ex. dashed lines or others.. i sometimes have a large number of plots to do, and the 7 default plot colors are not enough... I know I could manually make a handler in my program to handle the colors when I plot... but it would seem nicer if I could just pass a list of plot colors to matplotlib. Regards, Soren - 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] CocoaAgg backend status?
On Dec 5, 2007 8:37 AM, Stephen Uhlhorn [EMAIL PROTECTED] wrote: I was just wondering what the status of the CocoaAgg backend is since there is not much info available. Can it be used interactively w/ipython? I don't know for a fact, but the answer is probalby no. Each GUI backend requires an explicit implementation in ipython, since they all have their own threading/callback/timer quirks (even qt3 and qt4 are different). Thus far, we don't have one for Cocoa. It may 'just work', but I don't know that, so if you find that it doesn't, and decide to dig in to implement the support, by all means send it our way! The file to look at for inspiration is: http://projects.scipy.org/ipython/ipython/browser/ipython/trunk/IPython/Shell.py Cheers, f - 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
rex wrote: 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? [...] 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. If you happen to use Mozilla Thunderbird, there is an extension [1] that enables Reply-To-List. This works with a patched version of Thunderbird, which is included in several major distros. [1] http://alumnit.ca/wiki/index.php?page=ReplyToListThunderbirdExtension -- Random number generation is the art of producing pure gibberish as quickly as possible. - 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] How to show matplotlib.image ?
On Dec 1, 2007 7:47 PM, hjc520070 [EMAIL PROTECTED] wrote: The following run well . But I just want to make the image, with the x and y as axis and z as the image value ,show on the figure. In the pylab , we can just give a command imshow ,But here , I fail to do it , I have try ax.imshow() again and again ,but fail. Can sb give me some advice . Thank you . You cannot import pylab and use the FigureCanvasWx at the same time. Please follow the lead of examples/embedding_in_wx*.py if you want to use matplotlib in a wxpython GUI. Using pylab at the same time as the API is undefined and unsupported. JDH - 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
[Matplotlib-users] ImportError: cannot import name rcParams
Hi All, I'm running into the following error when I try to run any of the matplotlib examples: $ python anim.py Traceback (most recent call last): File anim.py, line 19, in module import pylab as p File C:\Python25\Lib\site-packages\pylab.py, line 1, in module from matplotlib.pylab import * File C:\Python25\Lib\site-packages\matplotlib\pylab.py, line 206, in module from matplotlib.numerix import npyma as ma File C:\Python25\Lib\site-packages\matplotlib\numerix\__init__.py, line 20, in module from matplotlib import rcParams, verbose ImportError: cannot import name rcParams I'm using the latest versions of matplotlib and numpy, ActivePython 2.5 (all for Windows XP). Any help would be appreciated. Regards, Brian. - 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] TypeError on CocoaAgg backend
On Dec 5, 2007 12:36 PM, Barry Wark [EMAIL PROTECTED] wrote: Chris, I appologize for cryptic language and quickly written emails leading you astray. I've included the diff of backend_cocoaagg.py (which has also been sent to the mpl devs) which seems to work for me. I committed in r4571, presuming it is the same patch you sent before... JDH - 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] number rendering in GTKCairo
Sorry for the wild goose chase. Now that my memory has been jogged -- This is actually a known problem with the Cairo backend. Cairo only allows access to fonts installed in the normal OS-specific places (and /usr/lib/python2.5/site-packages/matplotlib/mpl-data/fonts/ttf is definitely not one of them... ;) Worse than that, AFAIK, there is know way of knowing whether a particular font was found, so we can't give users a nice warning message when your situation occurs. To remedy: Install all of the matplotlib fonts into a standard place where fontconfig will find them (such as ~/.fonts). Then run fc-cache to regenerate the font cache. Matplotlib's Cairo backend should hopefully work after that. You can also use the regular PDF backend, which doesn't exhibit this problem. If there's a reason why the Cairo PDF output is better than the normal PDF backend's output for you, please let us know. What I'm puzzled by now is -- why did the Cairo backend work for you on the Mac? Did you install the fonts there? I'm not on the Mac much --- but I'd be very surprised if Cairo found the CM fonts as installed by matplotlib automagically there. Cheers, Mike Brian Baughman wrote: Hello, Below is the requested output which looks correct to me: [EMAIL PROTECTED]:~/dev/pyanalysis$ python Python 2.5.1 (r251:54863, Oct 5 2007, 13:36:32) [GCC 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)] on linux2 Type help, copyright, credits or license for more information. import matplotlib matplotlib.__file__ '/usr/lib/python2.5/site-packages/matplotlib/__init__.pyc' matplotlib.__version__ '0.91.2svn' matplotlib._get_data_path() '/usr/lib/python2.5/site-packages/matplotlib/mpl-data' Deleting the ~/.matplotlib/fontManager.cache did not change the behavior. Thanks for all the help. I really like using matplotlib on my Mac but it doesn't have the power that my Ubuntu box has. Regards, Brian On Dec 5, 2007, at 2:52 PM, Michael Droettboom wrote: What's happening is that it isn't finding the Bakoma Computer Modern fonts. These have a non-standard encoding, so the '-' for instance, is actually under a different character code. So... we need to track down why it's looking in the wrong place. Can you send the output of: python Python 2.5.1 (r251:54863, Jul 2 2007, 08:53:40) [GCC 3.4.6 20060404 (Red Hat 3.4.6-8)] on linux2 Type help, copyright, credits or license for more information. import matplotlib matplotlib.__file__ '/home/mdroe/usr/lib/python2.5/site-packages/matplotlib/__init__.pyc' matplotlib.__version__ '0.91.2.svn' matplotlib._get_data_path() '/home/mdroe/usr/lib/python2.5/site-packages/matplotlib/mpl-data' You may also try deleting your font cache in ~/.matplotlib/fontManager.cache Cheers, Mike -- Michael Droettboom Science Software Branch Operations and Engineering Division Space Telescope Science Institute Operated by AURA for NASA - 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] converting GMT color palettes to pylab colormaps
Michael Hearne wrote: Does anyone here have any experience converting GMT color palettes into pylab colormaps? I took a stab at it, and the results are not really what I expected. GMT, for the unfamiliar, is a scientific plotting/mapping package that I'm doing my best to rid myself of. If you've never heard of it, then you can probably ignore this message. Here's my attempt at bringing in a GMT color palette: #!/usr/bin/python from pylab import * #GMT color palette - Colors are specified by a RGB triplet with each value in the range #0-255. The palette below specifies that a data value between 1 and 2 will be assigned a color #linearly interpreted between the colors (255,255,255) and (191,204,255). # 0 255 255 255 1 255 255 255 # 1 255 255 255 2 191 204 255 # 2 191 204 255 3 160 230 255 # 3 160 230 255 4 128 255 255 # 4 128 255 255 5 122 255 147 # 5 122 255 147 6 255 255 0 # 6 255 255 0 7 255 200 0 # 7 255 200 0 8 255 145 0 # 8 255 145 0 9 255 0 0 # 9 255 0 0 10 200 0 0 # 10 200 0 0 13 128 0 0 cdict = {'red': ((0.0,1.00,1.0), (0.1,1.00,0.75), (0.2,0.75,0.63), (0.3,0.63,0.50), (0.4,0.50,0.48), (0.5,0.48,1.00), (0.6,1.00,1.00), (0.7,1.00,1.00), (0.8,1.00,1.00), (0.9,1.00,0.78), (1.0,0.78,0.50)), 'green': ((0.0,1.00,1.00), (0.1,1.00,0.80), (0.2,0.80,0.90), (0.3,0.90,1.00), (0.4,1.00,1.00), (0.5,1.00,1.00), (0.6,1.00,0.78), (0.7,0.78,0.57), (0.8,0.57,0.00), (0.9,0.00,0.00), (1.0,0.00,0.00)), 'blue': ((0.0,1.00,1.00), (0.1,1.00,1.00), (0.2,1.00,1.00), (0.3,1.00,1.00), (0.4,1.00,0.58), (0.5,0.58,0.00), (0.6,0.00,0.00), (0.7,0.00,0.00), (0.8,0.00,0.00), (0.9,0.00,0.00), (1.0,0.00,0.00))} my_cmap = matplotlib.colors.LinearSegmentedColormap('my_colormap',cdict) pcolor(rand(10,10),cmap=my_cmap) colorbar() savefig('colormap.png') Michael: The basemap toolkit includes the GMT colormaps. To access them, import cm from the basemap namespace (from matplotlib.toolkits.basemap import cm). The names are prefixed with 'GMT_'. -Jeff -- Jeffrey S. Whitaker Phone : (303)497-6313 Meteorologist FAX: (303)497-6449 NOAA/OAR/PSD R/PSD1Email : [EMAIL PROTECTED] 325 BroadwayOffice : Skaggs Research Cntr 1D-124 Boulder, CO, USA 80303-3328 Web: http://tinyurl.com/5telg - 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
[Matplotlib-users] Error on importing basemap 0.9.8
Hi After updating to basemap-0.9.8 I'm getting the following error when trying to import the basemap module on Intel Mac OS X Leopard using Python-2.5.1 from MacPorts Python 2.5.1 (r251:54863, Nov 22 2007, 18:02:58) [GCC 4.0.1 (Apple Inc. build 5465)] on darwin Type help, copyright, credits or license for more information. from matplotlib.toolkits import basemap Traceback (most recent call last): File stdin, line 1, in module File /opt/local/lib/python2.5/site-packages/matplotlib/toolkits/basemap/__init__.py, line 1, in module from basemap import __doc__, __version__ File /opt/local/lib/python2.5/site-packages/matplotlib/toolkits/basemap/basemap.py, line 31, in module import _geos, pupynere File /opt/local/lib/python2.5/site-packages/matplotlib/toolkits/basemap/pupynere.py, line 36, in module from dap.client import open as open_remote File /opt/local/lib/python2.5/site-packages/dap/__init__.py, line 12, in module __import__('pkg_resources').declare_namespace(__name__) ImportError: No module named pkg_resources Am I missing a required module? Cheers Adam - 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] Error on importing basemap 0.9.8
On Dec 5, 2007 9:13 PM, Adam Mercer [EMAIL PROTECTED] wrote: ImportError: No module named pkg_resources Am I missing a required module? Looks like you need setuptools http://peak.telecommunity.com/DevCenter/EasyInstall#installing-easy-install - 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] Error on importing basemap 0.9.8
On Dec 5, 2007 10:30 PM, John Hunter [EMAIL PROTECTED] wrote: Looks like you need setuptools http://peak.telecommunity.com/DevCenter/EasyInstall#installing-easy-install Thanks John, installing setuptools did the trick. Cheers Adam - 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
[Matplotlib-users] power law fitting of data
Hi, I have (x,y) data that I want to fit to the formula y = a * x^b to determine a and b. How can I do it? The current manual only lists linear fit and polynomial fit. Or, putting it in a more general setting, is there a module to do fitting to an arbitrary function? It would be something like pars = fit(x, y, func) where func is a function like y = func(x, pars) with pars a 1-D array. Thanks, Ping - 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] power law fitting of data
Ping, You should investigate scipy.optimize.lsqFit for using least squares to fit an arbitrary function and scipy.odr for regular or orthogonal least squares fitting. barry On Dec 5, 2007 9:45 PM, Ping Yeh [EMAIL PROTECTED] wrote: Hi, I have (x,y) data that I want to fit to the formula y = a * x^b to determine a and b. How can I do it? The current manual only lists linear fit and polynomial fit. Or, putting it in a more general setting, is there a module to do fitting to an arbitrary function? It would be something like pars = fit(x, y, func) where func is a function like y = func(x, pars) with pars a 1-D array. Thanks, Ping - 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 - 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] power law fitting of data
Hi, You could use another package, like openopt and the generic optimizers that give you what you want provided that you create at least the gradient of the function (I didn't create a class that can numerically derive a fit function). For instance http://projects.scipy.org/scipy/scikits/wiki/Optimization/tutorial#FittingDatagives you an example. Matthieu 2007/12/6, Ping Yeh [EMAIL PROTECTED]: Hi, I have (x,y) data that I want to fit to the formula y = a * x^b to determine a and b. How can I do it? The current manual only lists linear fit and polynomial fit. Or, putting it in a more general setting, is there a module to do fitting to an arbitrary function? It would be something like pars = fit(x, y, func) where func is a function like y = func(x, pars) with pars a 1-D array. Thanks, Ping - 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 -- French PhD student Website : http://miles.developpez.com/ Blogs : http://matt.eifelle.com and http://blog.developpez.com/?blog=92 LinkedIn : http://www.linkedin.com/in/matthieubrucher - 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