You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(3) |
Jun
|
Jul
|
Aug
(12) |
Sep
(12) |
Oct
(56) |
Nov
(65) |
Dec
(37) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(59) |
Feb
(78) |
Mar
(153) |
Apr
(205) |
May
(184) |
Jun
(123) |
Jul
(171) |
Aug
(156) |
Sep
(190) |
Oct
(120) |
Nov
(154) |
Dec
(223) |
2005 |
Jan
(184) |
Feb
(267) |
Mar
(214) |
Apr
(286) |
May
(320) |
Jun
(299) |
Jul
(348) |
Aug
(283) |
Sep
(355) |
Oct
(293) |
Nov
(232) |
Dec
(203) |
2006 |
Jan
(352) |
Feb
(358) |
Mar
(403) |
Apr
(313) |
May
(165) |
Jun
(281) |
Jul
(316) |
Aug
(228) |
Sep
(279) |
Oct
(243) |
Nov
(315) |
Dec
(345) |
2007 |
Jan
(260) |
Feb
(323) |
Mar
(340) |
Apr
(319) |
May
(290) |
Jun
(296) |
Jul
(221) |
Aug
(292) |
Sep
(242) |
Oct
(248) |
Nov
(242) |
Dec
(332) |
2008 |
Jan
(312) |
Feb
(359) |
Mar
(454) |
Apr
(287) |
May
(340) |
Jun
(450) |
Jul
(403) |
Aug
(324) |
Sep
(349) |
Oct
(385) |
Nov
(363) |
Dec
(437) |
2009 |
Jan
(500) |
Feb
(301) |
Mar
(409) |
Apr
(486) |
May
(545) |
Jun
(391) |
Jul
(518) |
Aug
(497) |
Sep
(492) |
Oct
(429) |
Nov
(357) |
Dec
(310) |
2010 |
Jan
(371) |
Feb
(657) |
Mar
(519) |
Apr
(432) |
May
(312) |
Jun
(416) |
Jul
(477) |
Aug
(386) |
Sep
(419) |
Oct
(435) |
Nov
(320) |
Dec
(202) |
2011 |
Jan
(321) |
Feb
(413) |
Mar
(299) |
Apr
(215) |
May
(284) |
Jun
(203) |
Jul
(207) |
Aug
(314) |
Sep
(321) |
Oct
(259) |
Nov
(347) |
Dec
(209) |
2012 |
Jan
(322) |
Feb
(414) |
Mar
(377) |
Apr
(179) |
May
(173) |
Jun
(234) |
Jul
(295) |
Aug
(239) |
Sep
(276) |
Oct
(355) |
Nov
(144) |
Dec
(108) |
2013 |
Jan
(170) |
Feb
(89) |
Mar
(204) |
Apr
(133) |
May
(142) |
Jun
(89) |
Jul
(160) |
Aug
(180) |
Sep
(69) |
Oct
(136) |
Nov
(83) |
Dec
(32) |
2014 |
Jan
(71) |
Feb
(90) |
Mar
(161) |
Apr
(117) |
May
(78) |
Jun
(94) |
Jul
(60) |
Aug
(83) |
Sep
(102) |
Oct
(132) |
Nov
(154) |
Dec
(96) |
2015 |
Jan
(45) |
Feb
(138) |
Mar
(176) |
Apr
(132) |
May
(119) |
Jun
(124) |
Jul
(77) |
Aug
(31) |
Sep
(34) |
Oct
(22) |
Nov
(23) |
Dec
(9) |
2016 |
Jan
(26) |
Feb
(17) |
Mar
(10) |
Apr
(8) |
May
(4) |
Jun
(8) |
Jul
(6) |
Aug
(5) |
Sep
(9) |
Oct
(4) |
Nov
|
Dec
|
2017 |
Jan
(5) |
Feb
(7) |
Mar
(1) |
Apr
(5) |
May
|
Jun
(3) |
Jul
(6) |
Aug
(1) |
Sep
|
Oct
(2) |
Nov
(1) |
Dec
|
2018 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2020 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2025 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Chris B. <Chr...@no...> - 2005-02-01 20:58:31
|
Thanks John and Andrew. Now I've changed my matplotlibrc to use the Agg backend by default. It would be nice if the default could be set appropriately on install, but I have no idea how one would do that. However, I doubt that GTKAgg is the default on Windows, so maybe there is a way! -Chris -- Christopher Barker, Ph.D. Oceanographer NOAA/OR&R/HAZMAT (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chr...@no... |
From: Chris B. <Chr...@no...> - 2005-02-01 20:55:40
|
Pressing "send" too soon... To partially answer my own question, I looked in matplotlib.pylab.py, and found: manager = get_current_fig_manager() manager.canvas.print_figure(*args, **kwargs) However, I can't see how to get the canvas from a figure instance. This looks like one place the OO interface could be improved. -Chris -- Christopher Barker, Ph.D. Oceanographer NOAA/OR&R/HAZMAT (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chr...@no... |
From: Chris B. <Chr...@no...> - 2005-02-01 20:43:43
|
Hi all, There has been some recent discussion about perhaps improving the OO interface. So Here's a question: How do I save an AGG figure with the OO interface? For example: >>> fig = pylab.figure() >>> ax = fig.add_subplot(1,1,1) >>> ax.plot(range(10), pylab.sin(range(10))) Now how do I save it as a PNG? I can do: >>> pylab.savefig("test.png") But then that is the interface I'm trying to get away from. Looking at the docs, it looks like the agg back-end should have: >>> fig.print_figure("Test.png") Traceback (most recent call last): File "<stdin>", line 1, in ? AttributeError: Figure instance has no attribute 'print_figure' But no such luck. Another option would be: >>> fig.savefig But that's not there either. Thanks, -Chris -- Christopher Barker, Ph.D. Oceanographer NOAA/OR&R/HAZMAT (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chr...@no... |
From: John H. <jdh...@ac...> - 2005-02-01 19:33:29
|
>>>>> "Andrew" == Andrew Straw <str...@as...> writes: Andrew> What does your .matplotlibrc say on the "backend" line? To flesh out Andrew's answer a bit, see http://matplotlib.sourceforge.net/faq.html#MATPLOTLIBRC and http://matplotlib.sourceforge.net/backends.html Cheers, JDH |
From: Andrew S. <str...@as...> - 2005-02-01 19:18:39
|
Chris Barker wrote: > Hi all, > > I'm working on installing matplotlib on a fink-free OS-X. When I have > it all working, I'll post the methodology here. > > I've got it all compiled and installed, but when I run it, I get: > > Python 2.3 (#1, Sep 13 2003, 00:49:11) > [GCC 3.3 20030304 (Apple Computer, Inc. build 1495)] on darwin > Type "help", "copyright", "credits" or "license" for more information. > >>> import pylab > Could not open font file /Library/Fonts/NISC18030.ttf > No module named pygtk > PyGTK version 1.99.16 or greater is required to run the GTK Matplotlib > backends > > This makes sense, as I don't have PyGTK, However, I would have thought > that setup.py would have figured that out, and not tried to build it. > At this point, all I need is to generate images with the AGG back-end, > so why is it trying to run PyGTK on import? What does your .matplotlibrc say on the "backend" line? |
From: Chris B. <Chr...@no...> - 2005-02-01 18:33:15
|
Hi all, I'm working on installing matplotlib on a fink-free OS-X. When I have it all working, I'll post the methodology here. I've got it all compiled and installed, but when I run it, I get: Python 2.3 (#1, Sep 13 2003, 00:49:11) [GCC 3.3 20030304 (Apple Computer, Inc. build 1495)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import pylab Could not open font file /Library/Fonts/NISC18030.ttf No module named pygtk PyGTK version 1.99.16 or greater is required to run the GTK Matplotlib backends This makes sense, as I don't have PyGTK, However, I would have thought that setup.py would have figured that out, and not tried to build it. At this point, all I need is to generate images with the AGG back-end, so why is it trying to run PyGTK on import? If I do: >>> import matplotlib >>> matplotlib.use('Agg') >>> import pylab Then it works OK. It would be nice to just do an "import pylab", however. -Chris -- Christopher Barker, Ph.D. Oceanographer NOAA/OR&R/HAZMAT (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chr...@no... |
From: Chris B. <Chr...@no...> - 2005-02-01 17:47:01
|
John Hunter wrote: > Well, there are two exceptions to this: set operates on sequences or > instances, and can handle multiple key/val pairs. So you can do > > set(labels, rotation=45, fontsize=14, color='red') > > in place of > > for label in labels: > label.set_rotation(45) > label.set_fontsize(14) > label.set_color('red') > > I prefer the former, particularly when working from the python shell. > But it's a matter of taste... That is handy. Actually, I really like it when you can work with sets of objects, rather than doing the explicit looping all the time. It just goes to show you that OO design is not always the best answer. Now the question is: What namespace should set() live in? pylab.set() works for me. I'm now working on a Fink-free OS-X install, which is proving to be quite a chore. I'll report here when I'm done. -Chris -- Christopher Barker, Ph.D. Oceanographer NOAA/OR&R/HAZMAT (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chr...@no... |
From: John H. <jdh...@ac...> - 2005-02-01 13:48:41
|
>>>>> "Delbert" == Delbert D Franz <dd...@lk...> writes: Delbert> I have made great progress with my GUI to plot Delbert> time-series files from my unsteady-flow modeling Delbert> software. It works when I have one subplot per figure Delbert> but I have not been able to get two subplots (211 and Delbert> 212) to work. Only the lower subplot appears and the Delbert> trace or line assigned to the upper subplot (211) appears Delbert> in the lower subplot. The space for the upper subplot Delbert> appears as blank space in the figure. You code looks correct on first glance (except did you mean tht title to be in the loop?) . My guess is your data structure has a bug in it. Add a print statement and make sure the loc code is as you think it is. print fg.fgs[ifg].sp[isp].loc_code ax = f.add_subplot(fg.fgs[ifg].sp[isp].loc_code) If they are correct, you need to compose a minimum, free standing script that replicates your problem and I can take a look. Hope this helps, JDH |
From: Delbert D. F. <dd...@lk...> - 2005-02-01 06:16:09
|
I have made great progress with my GUI to plot time-series files from my unsteady-flow modeling software. It works when I have one subplot per figure but I have not been able to get two subplots (211 and 212) to work. Only the lower subplot appears and the trace or line assigned to the upper subplot (211) appears in the lower subplot. The space for the upper subplot appears as blank space in the figure. I'm a little unsure of how to embed multiple subplots using Tk. I based what I did on examples using pylab and tried to translate them to my case. Here's the code that does the work. The fg.fgs..., is a data structure that holds various descriptive items for the figure, subplot, and the various traces. The case that fails has 2 subplots with one trace per subplot. file_list holds various file-related objects that get the data from one or more files when it is needed. ifg = 0 win = Toplevel(bd=5, relief=RIDGE) win.title(fg.fgs[ifg].name) # Try to setup useful time-series axis days = DayLocator(range(1,32)) hours = HourLocator((6,12,18)) timeformat = DateFormatter('%d %b %y') w = int(fg.fgs[ifg].width) h = int(fg.fgs[ifg].height) f = Figure(figsize=(w, h), dpi=120) nsp = len(fg.fgs[ifg].sp) # ax = [] for isp in xrange(nsp): ax = f.add_subplot(fg.fgs[ifg].sp[isp].loc_code) ntr = len(fg.fgs[ifg].sp[isp].tr) for itr in xrange(ntr): i = fg.fgs[ifg].sp[isp].tr[itr].file_index jt_0, f_0 = file_list[i].get_ts_segment() jt_0 += 678576.0 ax.plot_date(jt_0, f_0, fg.fgs[ifg].sp[isp].tr[itr].plot_code) ax.xaxis.set_major_locator(days) ax.xaxis.set_minor_locator(hours) ax.autoscale_view() labels = ax.get_xticklabels() ax.xaxis.set_major_formatter(timeformat) set(labels, rotation=85) ax.set_xlabel(fg.fgs[ifg].sp[isp].xlabel) ax.set_ylabel(fg.fgs[ifg].sp[isp].ylabel) ax.grid(True) ax.set_title(fg.fgs[ifg].title) canvas = FigureCanvasTkAgg(f, master=win) canvas.show() canvas.get_tk_widget().pack(side=TOP, fill=BOTH, expand=1) toolbar = NavigationToolbar( canvas, win ) toolbar.update() canvas._tkcanvas.pack(side=TOP, fill=BOTH, expand=1) canvas._tkcanvas.pack(side=TOP, expand=1) canvas.print_figure('test.ps', dpi=300, orientation='landscape') I'm finding that Python and matplotlib are fun to use but I'm still low on the learning curve. However, I already have a usable package and can now start adding refinements and extensions. Thanks, Delbert Franz |
From: Dominique O. <Dom...@po...> - 2005-01-31 23:31:49
|
John Hunter wrote: >>>>>>"Dominique" == Dominique Orban <Dom...@po...> writes: > > Dominique> Regarding the use of transforms in Matplotlib, what > Dominique> would be the simplest way to convert a quantity > Dominique> expressed in data coordinates to points and conversely? > > # display coords > dx, dy = trans.xy_tup(x, y) > > # points from left of figure window > px = dx/dpi*72 > > # points from bottom of figure window > py = dy/dpi*72 Thanks, I think I understand. The reason I ask is to be able to compute displacements in data coordinates when they are given in points. Now I am confused by the following test (Windows XP, Matplotlib 0.71, Numeric 23.0 from the Enthought edition of Python 2.3): ################## from matplotlib.pylab import * from matplotlib import rcParams dpi = rcParams['figure.dpi'] ppi = 72.0 ratio = ppi/dpi ax = axes( [0.1, 0.1, 0.8, 0.8] ) trans = ax.transData z = (0,0) dz = trans.xy_tup( z ) ddz = ( dz[0]*ratio, dz[1]*ratio ) print str(z) + ' in data units is ' + str(ddz) + ' in screen coords' # See how many data units in each direction is a # displacement of 'delta' points in each direction delta = 5 r = ( ddz[0] + delta, ddz[1] + delta) # = origin + (10, 10) rdx, rdy = trans.inverse_xy_tup( r ) rddx = rdx/ratio rddy = rdy/ratio print str(r) + ' in screen coords is ' + str((rddx,rddy)) + ' in data units' ################## This script produces: (0, 0) in data units is (57.600000000000001, 43.200000000000003) in screen coords (62.600000000000001, 48.200000000000003) in screen coords is (-0.0030381944444444415, 0.00057870370370370161) in data units How is it possible that I obtain a negative number in this last tuple? Is it a numerical error or am I missing something? A second question: I want to draw a line going from (0,0) to (1,1), but that stops short of (1,1), leaving just enough room for an object that has a radius of 5 points. Is this how I should compute how far from (1,1) the line should stop, in data coordinates? Yes, this is related to the arrow class I mentioned in an earlier post. This is an attempt to adjust the position of the arrow head, so its tip points to, e.g., (1,1) and the stem is just long enough that it doesn't overlap with the head. I'm probably not choosing the easy way but then, I am not sure what the easy way would be. Many thanks, Dominique |
From: John H. <jdh...@ac...> - 2005-01-31 23:20:09
|
>>>>> "seberino" == seberino <seb...@sp...> writes: seberino> I have great working matplotlib pylab code that fires seberino> off a new plot when asked to. seberino> Now we want to embed/add this code into an existing wx seberino> gui....Is it possible to make the pylab code embed the seberino> plot into an existing gui window rather than creating a seberino> //new// plot window/widget? seberino> Also, a colleague says wx doesn't seem to play nice with seberino> pylab module. Is pylab somehow slower or not the best seberino> fit with wx?? He says 'Figure()' code seems better with seberino> wx. Any advice/comments greatly appreciated. Your colleague is right. The main problem with mixing the pylab interface with your own wx widgets is that pylab controls the windows it creates, eg managing destroy etc. For examples on how to embed matplotlib is an wx application, see the examples/embedding_in_wx*.py demos in the matplotlib src distro. Hope this helps! JDH |
From: John H. <jdh...@ac...> - 2005-01-31 22:41:06
|
>>>>> "Tom" == Tom Loredo <lo...@as...> writes: Tom> /usr/include/pygtk-2.0/pygobject.h:140: error: expected `,' Tom> or `...' before "typename" Tom> /usr/include/pygtk-2.0/pygobject.h:147: error: expected `,' Tom> or `...' before "typename" error: command 'gcc' failed with Tom> exit status 1 Hey Tom, This looks a lot like the FAQ http://matplotlib.sourceforge.net/faq.html#PYGTK24 Hope this helps... JDH |
From: Matthew B. <mat...@gm...> - 2005-01-31 22:27:08
|
Hi, I ran into this recently. My own approach was merely to apply this change: http://cvs.gnome.org/viewcvs/gnome-python/pygtk/ChangeLog?rev=1.1053 "gobject/pygobject.h: s/typename/typename_/, because typename is a C++ keyword." Best, Matthew > I had some trouble installing matplotlib on a machine running > Fedora Core 3 and Python 2.3.4. I eventually got it to work, > and thought I'd pass on my experiences in case (1) they might > be helpful to other FC3 users, and (2) I may have overlooked > something that an FC3 expert can point out. > > I should note that I have two Pythons on this machine; Fedora's > is in /usr/bin, and I keep the one I use myself in /usr/local/bin, > so I can update it without fear of interfering with Fedora's > Python (standard Redhat/Fedora procedure, I believe). > > Here's the symptom: "python setup.py build" always quits > as follows: > > ~~~~~~~~~~~~~~~~~~~~~~~~~ > gcc -pthread -fno-strict-aliasing -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -I/usr/local/include -I/usr/include > -Isrc -Iagg22/include -I. -I/usr/local/include -I/usr/include -I/usr/local/include/freetype2 -I/usr/include/freetype2 > -Isrc/freetype2 -Iagg22/include/freetype2 -I./freetype2 -I/usr/local/include/freetype2 -I/usr/include/freetype2 > -I/usr/local/include -I/usr/include -I/usr/include/pygtk-2.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include > -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/X11R6/include -I/usr/include/atk-1.0 -I/usr/include/pango-1.0 > -I/usr/include/freetype2 -I/usr/include/freetype2/config -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include > -I/usr/local/include/python2.3 -c src/_gtkagg.cpp -o build/temp.linux-i686-2.3/src/_gtkagg.o > cc1plus: warning: command line option "-Wstrict-prototypes" is valid for Ada/C/ObjC but not for C++ > In file included from /usr/local/include/python2.3/Python.h:8, > from /usr/include/pygtk-2.0/pygobject.h:5, > from src/_gtkagg.cpp:8: > /usr/local/include/python2.3/pyconfig.h:850:1: warning: "_POSIX_C_SOURCE" redefined > In file included from /usr/include/string.h:26, > from /usr/lib/gcc/i386-redhat-linux/3.4.2/../../../../include/c++/3.4.2/cstring:51, > from src/_gtkagg.cpp:1: > /usr/include/features.h:150:1: warning: this is the location of the previous definition > In file included from src/_gtkagg.cpp:8: > /usr/include/pygtk-2.0/pygobject.h:140: error: expected `,' or `...' before "typename" > /usr/include/pygtk-2.0/pygobject.h:147: error: expected `,' or `...' before "typename" > error: command 'gcc' failed with exit status 1 > > ~~~~~~~~~~~~~~~~~~~~~~ > > This looks like a problem with the pytgtk installation. So I tried installing > pygtk from source. > > First I tried the latest/greatest version, 2.5.3, just posted on the pygtk site. > It requires a newer version of the GTK+ libraries than is included in FC3. > I tried installing these (first GLib, then Pango, ATK and GTK+) but > couldn't get past GLib. By default these install in /usr/local. FC3 comes > with them in /usr. What little I could find online indicates that it is > a BAD THING to have a newer version sitting in /usr/local, and that the > best procedure is to stick with the current version or install any updates > from RPMs. (It was not recommended that one overwrite the FC3 installation > via ./configure --prefix=/usr.) I could not find FC3 RPMs for the latest GTK+, > so I gave up on that, and deleted all the GTK stuff I had installed in /usr/local. > > Next I tried the previous stable version of pygtk, 2.4.1. The install > went fine, but a subsequent attempt at installing matplotlib duplicated > the problem noted above. However, pygtk installs into /usr/local by > default, and FC3 comes with it in /usr, and matplotlib was having a problem > with the /usr version. (Sure enough, a "diff" shows the newer version > I had in /usr/local has pygobject.h modified.) So I *reinstalled* 2.4.1 > into /usr using > > # ./configure --prefix=/usr > > Now matplotlib builds fine. I have copies of pygtk in both /usr and > /usr/local; I'm not sure if that will cause me problems. As root, > my shell runs /usr/local/bin/python; I suspect /usr/bin/python may > have an incompatible pygtk site-package at this point, but I haven't > pursued this since I don't use the FC3 python version myself. > > If FC3 experts out there can identify a problem with this procedure, > please let me know! > > Thanks, > Tom Loredo > > ------------------------------------------------- > This mail sent through IMP: http://horde.org/imp/ > > ------------------------------------------------------- > This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting > Tool for open source databases. Create drag-&-drop reports. Save time > by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc. > Download a FREE copy at http://www.intelliview.com/go/osdn_nl > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > |
From: Tom L. <lo...@as...> - 2005-01-31 22:07:23
|
Hi folks- I had some trouble installing matplotlib on a machine running Fedora Core 3 and Python 2.3.4. I eventually got it to work, and thought I'd pass on my experiences in case (1) they might be helpful to other FC3 users, and (2) I may have overlooked something that an FC3 expert can point out. I should note that I have two Pythons on this machine; Fedora's is in /usr/bin, and I keep the one I use myself in /usr/local/bin, so I can update it without fear of interfering with Fedora's Python (standard Redhat/Fedora procedure, I believe). Here's the symptom: "python setup.py build" always quits as follows: ~~~~~~~~~~~~~~~~~~~~~~~~~ gcc -pthread -fno-strict-aliasing -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -I/usr/local/include -I/usr/include -Isrc -Iagg22/include -I. -I/usr/local/include -I/usr/include -I/usr/local/include/freetype2 -I/usr/include/freetype2 -Isrc/freetype2 -Iagg22/include/freetype2 -I./freetype2 -I/usr/local/include/freetype2 -I/usr/include/freetype2 -I/usr/local/include -I/usr/include -I/usr/include/pygtk-2.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/X11R6/include -I/usr/include/atk-1.0 -I/usr/include/pango-1.0 -I/usr/include/freetype2 -I/usr/include/freetype2/config -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/local/include/python2.3 -c src/_gtkagg.cpp -o build/temp.linux-i686-2.3/src/_gtkagg.o cc1plus: warning: command line option "-Wstrict-prototypes" is valid for Ada/C/ObjC but not for C++ In file included from /usr/local/include/python2.3/Python.h:8, from /usr/include/pygtk-2.0/pygobject.h:5, from src/_gtkagg.cpp:8: /usr/local/include/python2.3/pyconfig.h:850:1: warning: "_POSIX_C_SOURCE" redefined In file included from /usr/include/string.h:26, from /usr/lib/gcc/i386-redhat-linux/3.4.2/../../../../include/c++/3.4.2/cstring:51, from src/_gtkagg.cpp:1: /usr/include/features.h:150:1: warning: this is the location of the previous definition In file included from src/_gtkagg.cpp:8: /usr/include/pygtk-2.0/pygobject.h:140: error: expected `,' or `...' before "typename" /usr/include/pygtk-2.0/pygobject.h:147: error: expected `,' or `...' before "typename" error: command 'gcc' failed with exit status 1 ~~~~~~~~~~~~~~~~~~~~~~ This looks like a problem with the pytgtk installation. So I tried installing pygtk from source. First I tried the latest/greatest version, 2.5.3, just posted on the pygtk site. It requires a newer version of the GTK+ libraries than is included in FC3. I tried installing these (first GLib, then Pango, ATK and GTK+) but couldn't get past GLib. By default these install in /usr/local. FC3 comes with them in /usr. What little I could find online indicates that it is a BAD THING to have a newer version sitting in /usr/local, and that the best procedure is to stick with the current version or install any updates from RPMs. (It was not recommended that one overwrite the FC3 installation via ./configure --prefix=/usr.) I could not find FC3 RPMs for the latest GTK+, so I gave up on that, and deleted all the GTK stuff I had installed in /usr/local. Next I tried the previous stable version of pygtk, 2.4.1. The install went fine, but a subsequent attempt at installing matplotlib duplicated the problem noted above. However, pygtk installs into /usr/local by default, and FC3 comes with it in /usr, and matplotlib was having a problem with the /usr version. (Sure enough, a "diff" shows the newer version I had in /usr/local has pygobject.h modified.) So I *reinstalled* 2.4.1 into /usr using # ./configure --prefix=/usr Now matplotlib builds fine. I have copies of pygtk in both /usr and /usr/local; I'm not sure if that will cause me problems. As root, my shell runs /usr/local/bin/python; I suspect /usr/bin/python may have an incompatible pygtk site-package at this point, but I haven't pursued this since I don't use the FC3 python version myself. If FC3 experts out there can identify a problem with this procedure, please let me know! Thanks, Tom Loredo ------------------------------------------------- This mail sent through IMP: http://horde.org/imp/ |
From: Stephen W. <ste...@cs...> - 2005-01-31 20:01:54
|
John Hunter wrote: >So the doc line with the tuple unpacking is *incorrect*, because tuple >unpacking will fail w/o the transpose. > Ouch. I completely missed the fact that Nicolas was commenting on the docstring, and generated a fair amount of noise as a result. Thanks, John. |
From: John H. <jdh...@ac...> - 2005-01-31 20:01:53
|
>>>>> "Dominique" == Dominique Orban <Dom...@po...> writes: Dominique> Regarding the use of transforms in Matplotlib, what Dominique> would be the simplest way to convert a quantity Dominique> expressed in data coordinates to points and conversely? Dominique> Are the methods gca().transData.xy_tup() and Dominique> inverse_xy_tup() what I'm looking for? If so, how Dominique> should I be calling them? I think the easiest way is to transform the data to screen coordinates and then apply a scale factor to convert pixels to points. All of the transform methods xy_tup(xy) - transform the tuple (x,y) seq_x_y(x, y) - transform the python sequences x and y numerix_x_y(x, y) - x and y are numerix 1D arrays seq_xy_tups(seq) - seq is a sequence of xy tuples return screen coords. To get points from left, bottom, you would could convert to inches by dividing by dpi, and then multiply by the number of points per inch. Untested, off the cuff, but should be right: # display coords dx, dy = trans.xy_tup(x, y) # points from left of figure window px = dx/dpi*72 # points from bottom of figure window py = dy/dpi*72 with the usual caveat that screen dpi is not the same in the x and y directions so the physical units may not be exact when displayed. JDH |
From: Humufr <hu...@ya...> - 2005-01-31 19:59:27
|
Yes thank you John. It's perfect. Sorry for this but I pass so many times to understand the problem that I was thinking that another beginner will have the same problem than me. Nicolas John Hunter wrote: >>>>>>"Stephen" == Stephen Walton <ste...@cs...> writes: >>>>>> >>>>>> > > Stephen> Humufr wrote: > >> I agree with you but in the load function documentation I can > >> read this: > >> > >> x,y = load('test.dat') # data in two columns > > Stephen> The documentation for load is correct. Consider > > Stephen> A=load('test.dat') > > Stephen> If 'test.dat' has 17 rows and 2 columns, A.shape will be > Stephen> (17,2), "print A" will print an array with 17 rows and 2 > Stephen> columns, and so on. But > > Stephen> x,y=A > > Stephen> will not work, because tuple unpacking of numarray arrays > Stephen> goes by rows, not by columns. > >So the doc line with the tuple unpacking is *incorrect*, because tuple >unpacking will fail w/o the transpose. I modified the docs to read > > Example usage: > > X = load('test.dat') # data in two columns > t = X[:,0] > y = X[:,1] > > Alternatively, you can do > > t,y = transpose(load('test.dat')) # for two column data > >Everybody happy with that? > >JDH > > |
From: Chris B. <Chr...@no...> - 2005-01-31 19:56:40
|
Python is not MATLAB! Humufr wrote: > I agree with you but in the load function documentation I can read this: > and not a file like: > > 1 1 1 1 1 > 2 2 2 2 2 > > it's why I suggest to add the transpose in the load function. However, Matlab does exactly this, for the same reason. I always thought that was stupid, but a goal of pylab is to be matlab compatible, so it should probably not be transposed automatically. > For the comments for the beggining of an array indexing I know it :) but > I hate it (it's just a tast :) ) You may come to love it. I know I do. While indexing from 1 seems most natural at first, it results in ugly arithmetic when slicing. I came from Matlab, and python's indexing seemed ugly at first, but then I found that so many thing work much more naturally: len(a[i:j]) = j-i len(s[-3:]) = 3 l[i:j] + l[j:k] = l[i:k] You'd be adding and subtracting a lot of ones if python had one-based indexing. Also, if you have a grid, spaced out by DeltaX: The X -coord of a[i] is: X0 + i*DeltaX With one based indexing, it would be: X0 + (i-1) * DeltaX But most of all, Python indexes from 0, whether you like it or not, so it's probably best to stick with that in Python functions. -Chris -- Christopher Barker, Ph.D. Oceanographer NOAA/OR&R/HAZMAT (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chr...@no... |
From: John H. <jdh...@ac...> - 2005-01-31 19:46:26
|
>>>>> "Stephen" == Stephen Walton <ste...@cs...> writes: Stephen> Humufr wrote: >> I agree with you but in the load function documentation I can >> read this: >> >> x,y = load('test.dat') # data in two columns Stephen> The documentation for load is correct. Consider Stephen> A=load('test.dat') Stephen> If 'test.dat' has 17 rows and 2 columns, A.shape will be Stephen> (17,2), "print A" will print an array with 17 rows and 2 Stephen> columns, and so on. But Stephen> x,y=A Stephen> will not work, because tuple unpacking of numarray arrays Stephen> goes by rows, not by columns. So the doc line with the tuple unpacking is *incorrect*, because tuple unpacking will fail w/o the transpose. I modified the docs to read Example usage: X = load('test.dat') # data in two columns t = X[:,0] y = X[:,1] Alternatively, you can do t,y = transpose(load('test.dat')) # for two column data Everybody happy with that? JDH |
From: Stephen W. <ste...@cs...> - 2005-01-31 19:38:15
|
Humufr wrote: > I agree with you but in the load function documentation I can read this: > > x,y = load('test.dat') # data in two columns The documentation for load is correct. Consider A=load('test.dat') If 'test.dat' has 17 rows and 2 columns, A.shape will be (17,2), "print A" will print an array with 17 rows and 2 columns, and so on. But x,y=A will not work, because tuple unpacking of numarray arrays goes by rows, not by columns. |
From: Humufr <hu...@ya...> - 2005-01-31 19:00:20
|
I agree with you but in the load function documentation I can read this: x,y = load('test.dat') # data in two columns so if I interpret this correctly that means a data file like: 1 2 1 2 1 2 1 2 1 2 and not a file like: 1 1 1 1 1 2 2 2 2 2 it's why I suggest to add the transpose in the load function. For the second things (the columns). Your example show that you can read two columns consecutive but if you want read the columns 3,5,7,8 that can't work. Like it's only an optionnal argument I was thinking that was possible to add this possibilty in the load function inside pylab. For the comments for the beggining of an array indexing I know it :) but I hate it (it's just a tast :) ) and I prefer to name/count the column in a data file from 1 so instead to tell to someone: "Use the zero columns" I prefer to tell "Use the first columns". It's only a matter of choice. But it's why I add: array(columns)-1. Nicolas Stephen Walton wrote: > I don't think the load function needs to be changed in the way you > suggest. The "problem" is not the load function. It is the fact that > numarray arrays are stored in row-major, not column-major, order, and > so tuple unpacking a numarray array goes by row, not by column. > > In [15]: A=arange(6) > > In [16]: A.shape=(3,2) > > In [17]: x,y=A > --------------------------------------------------------------------------- > > exceptions.ValueError Traceback (most > recent call last) > > ValueError: too many values to unpack > > The transpose is required here as well if you want to unpack by > columns. If I have a file containing 731 rows and 17 columns and use > 'load', I get an array with 731 rows and 17 columns, exactly as I expect. > > I'm far from a Python expert myself ;-) , but you can do what you're > trying with the single line > > x,y=transpose(load('toto.dat')[:,1:3]) > > (note that array indexing in Python is zero-based, not one-based, and > also read up on how slices work). > > |
From: Stephen W. <ste...@cs...> - 2005-01-31 18:40:23
|
I don't think the load function needs to be changed in the way you suggest. The "problem" is not the load function. It is the fact that numarray arrays are stored in row-major, not column-major, order, and so tuple unpacking a numarray array goes by row, not by column. In [15]: A=arange(6) In [16]: A.shape=(3,2) In [17]: x,y=A --------------------------------------------------------------------------- exceptions.ValueError Traceback (most recent call last) ValueError: too many values to unpack The transpose is required here as well if you want to unpack by columns. If I have a file containing 731 rows and 17 columns and use 'load', I get an array with 731 rows and 17 columns, exactly as I expect. I'm far from a Python expert myself ;-), but you can do what you're trying with the single line x,y=transpose(load('toto.dat')[:,1:3]) (note that array indexing in Python is zero-based, not one-based, and also read up on how slices work). |
From: Dominique O. <Dom...@po...> - 2005-01-31 18:33:31
|
Regarding the use of transforms in Matplotlib, what would be the simplest way to convert a quantity expressed in data coordinates to points and conversely? Are the methods gca().transData.xy_tup() and inverse_xy_tup() what I'm looking for? If so, how should I be calling them? Thanks Dominique |
From: Humufr <hu...@ya...> - 2005-01-31 16:01:58
|
Hi John, I did some change in the load function, it's help for me so perhaps some other people will appreciate it. I add the possibility to choose which columns inside a file you want use. ex: I have a file like: 1 2 3 1 2 3 1 2 3 and I want use only the columns 2 and 3: so I can do this with the new load function: load('toto.dat',columns=[2,3]) Perhaps you can arrange this to have something a little bit cleaner (I'm a beginner with python). I add the change to have the matrix transpose too to correct the problem I hab before to recuperate the columns and not the lines when you are doing: x,y,z = load('toto.dat') Thanks, Nicolas ps: I add something inside the doc but you had to correct this too for a correct english or/and more understandable text if you include these changes. ------------------------------------------------------------ def load(fname,comments='%',columns=None): """ Load ASCII data from fname into an array and return the array. The data must be regular, same number of values in every row fname can be a filename or a file handle. A character for to delimit the comments can be use (optional), the default is the matlab character '%'. An second optional argument can be add, to tell which columns you want use in the file. This arguments is a list who contains the number of columns beggining by 1. matfile data is not currently supported, but see Nigel Wade's matfile ftp://ion.le.ac.uk/matfile/matfile.tar.gz Example usage: x,y = load('test.dat') # data in two columns X = load('test.dat') # a matrix of data x = load('test.dat') # a single column of data x = load('test.dat,'#') # the character use like a comment delimiter is '#' """ if is_string_like(fname): fh = file(fname) elif hasattr(fname, 'seek'): fh = fname else: raise ValueError('fname must be a string or file handle') X = [] numCols = None for line in fh: line = line[:line.find(comments)].strip() if not len(line): continue row = [float(val) for val in line.split()] thisLen = len(row) if numCols is not None and thisLen != numCols: raise ValueError('All rows must have the same number of columns') if columns is not None: row = [row[i] for i in (array(columns)-1)] X.append(row) X = array(X) r,c = X.shape if r==1 or c==1: X.shape = max([r,c]), return transpose(X) |
From: <seb...@sp...> - 2005-01-30 04:22:53
|
I have great working matplotlib pylab code that fires off a new plot when asked to. Now we want to embed/add this code into an existing wx gui....Is it possible to make the pylab code embed the plot into an existing gui window rather than creating a //new// plot window/widget? Also, a colleague says wx doesn't seem to play nice with pylab module. Is pylab somehow slower or not the best fit with wx?? He says 'Figure()' code seems better with wx. Any advice/comments greatly appreciated. Sincerely, Chris |