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
|
S | M | T | W | T | F | S |
---|---|---|---|---|---|---|
|
|
1
(6) |
2
(29) |
3
(19) |
4
(6) |
5
(5) |
6
(9) |
7
(9) |
8
(19) |
9
(14) |
10
(19) |
11
(26) |
12
(10) |
13
(26) |
14
(22) |
15
(19) |
16
(17) |
17
(16) |
18
(2) |
19
|
20
(1) |
21
(1) |
22
(10) |
23
(11) |
24
(17) |
25
(6) |
26
(1) |
27
|
28
(9) |
29
(9) |
30
(9) |
|
|
|
I think that paths needed to be passed to CPP/LDFLAGS like this: CPPFLAGS=-I/usr/include/hdf LDFLAGS=-L/usr/lib ./configure --enable-hdf4 && make then also package is dependent on latest hdf5 to be build (1.8.7), so installing it globally would break possible dependencies in any packaging system, and lastly it's just pain to build it if it's worth On Sun, Nov 13, 2011 at 10:12 PM, Gökhan Sever <gok...@gm...> wrote: > When I remove hdf4 part from config, it builds successfully. Any ideas?
2011年11月12日 Friedrich Romstedt <fri...@gm...>: > $ stat -f "...." /Library/Fonts/NISC18030.ttf > Last accessed or modified: 1321107464 = 12 Nov 2011 > Last changed: 1264652963 = 28 Jan 2010 > Time of Birth: 1292365840 = 14 Dec 2010 The file might have been created earlier; the date 14 Dec 2010 is the day where I reinstalled my Mac after a HDD crash from backup. I have checked if I have backups older than that on one of the Time Machine disks but that is negative. But since Time Machine uses hardlinks to link the files between different backups the file backed up in the oldest backup from 27 Dec 2010 might have still the date of birth we're looking for. Assumed it didn't issue a completely new backup after restoring from the old one. I'm interested in this because I wonder how I ever got a working fontcache. It might be that I compiled matplotlib first differently, with python.org Python, hence gcc-4.0, and if we assume that it works under gcc-4.0, I would have ended up with a proper fontcache, and was free to compile with gcc-4.2 + 10.5 deployment target. Then the fontcache lived on all that years since Mid 2009 untouched. Until now, where it attempted to recreate it, with the gcc-4.2 + 10.5 targeted matplotlib, failing on that. I guess that the NISC18030.ttf in the backup has the date of birth of the first backup ever, meaning that it was probably present from the very beginning. This is suggested by the posts back to 2005, where the file existed on that ``bsd`` machine of William Stein, iirc. I strongly believe I just got a working intermediate matplotlib, which created the everlasting (or not) fontcache. Friedrich
On Sunday, November 13, 2011, Daniel Hyams <dh...@gm...> wrote: >> >> OK, types is a new part of the Python library for me, I'll have to go >> learn about it. It looks like you basically just subclassed the >> QuadContourSet object through a back door, by giving it the missing >> method. > > It's not a subclass, it's just a "monkey patch". I personally like > "duck punching", because even just reading the term makes me laugh: > "If it walks like a duck and quacks like a duck, it's a duck; or if it > does not walk or talk like a duck, punch it until it does". In this > case, we're punching the QuadContourSet until it behaves like an > Artist. It's a useful technique for experimenting, and can be used as > a patching technique in the interim until it is fixed properly. You > never want to write code like this on a regular basis, however. > > >> Your patch solves one of two animation problems, and I offer a >> suggestion about how to fix the second (with questions). >> >> The program gets as far as ani.save() on line 29 without generating any >> errors. An MP4 file showing animated contours is written to disk. The >> origin of the contour plot is in the lower left, versus the upper left >> of the original imshow() call, but that's expected. >> >> When you get to plt.show() on line 31, however: >> >> Traceback (most recent call last): >> File >> "/usr/local/lib/python2.6/dist-packages/matplotlib/backends/backend_gtk.py", line 127, in _on_timer >> TimerBase._on_timer(self) >> File >> "/usr/local/lib/python2.6/dist-packages/matplotlib/backend_bases.py", >> line 1091, in _on_timer >> ret = func(*args, **kwargs) >> File "/usr/local/lib/python2.6/dist-packages/matplotlib/animation.py", >> line 317, in _step >> still_going = Animation._step(self, *args) >> File "/usr/local/lib/python2.6/dist-packages/matplotlib/animation.py", >> line 179, in _step >> self._draw_next_frame(framedata, self._blit) >> File "/usr/local/lib/python2.6/dist-packages/matplotlib/animation.py", >> line 199, in _draw_next_frame >> self._post_draw(framedata, blit) >> File "/usr/local/lib/python2.6/dist-packages/matplotlib/animation.py", >> line 222, in _post_draw >> self._blit_draw(self._drawn_artists, self._blit_cache) >> File "/usr/local/lib/python2.6/dist-packages/matplotlib/animation.py", >> line 236, in _blit_draw >> bg_cache[a.axes] = a.figure.canvas.copy_from_bbox(a.axes.bbox) >> AttributeError: QuadContourSet instance has no attribute 'figure' > > It looks like just one more duck punch is needed; just set > > im.figure = fig > > after the setting of im.axes. QuadContourSet should really call > a.get_axes() and a.get_figure() instead of using the attributes > directly; doing so would allow any object that implements the proper > interfaces to work, artist or no. > >> Is this error occurring because there is no bit-mapped representation of >> a contour object? > > It's not really that, it's just that the animation class expects to be > given a list of Artists to work with (the original author can correct > me if I'm wrong), and that's not what it is being given, because a > QuadContourSet is not an Artist. But you can duck punch it until it > acts like one :D > > IMO, there are quite a few things in matplotlib that are a little > inconsistent in this way. > "duck-punching" Is that an official term? I have done things like this before, but never had a word for it. Ben Root
> > OK, types is a new part of the Python library for me, I'll have to go > learn about it. It looks like you basically just subclassed the > QuadContourSet object through a back door, by giving it the missing > method. It's not a subclass, it's just a "monkey patch". I personally like "duck punching", because even just reading the term makes me laugh: "If it walks like a duck and quacks like a duck, it's a duck; or if it does not walk or talk like a duck, punch it until it does". In this case, we're punching the QuadContourSet until it behaves like an Artist. It's a useful technique for experimenting, and can be used as a patching technique in the interim until it is fixed properly. You never want to write code like this on a regular basis, however. > Your patch solves one of two animation problems, and I offer a > suggestion about how to fix the second (with questions). > > The program gets as far as ani.save() on line 29 without generating any > errors. An MP4 file showing animated contours is written to disk. The > origin of the contour plot is in the lower left, versus the upper left > of the original imshow() call, but that's expected. > > When you get to plt.show() on line 31, however: > > Traceback (most recent call last): > File > "/usr/local/lib/python2.6/dist-packages/matplotlib/backends/backend_gtk.py", line 127, in _on_timer > TimerBase._on_timer(self) > File > "/usr/local/lib/python2.6/dist-packages/matplotlib/backend_bases.py", > line 1091, in _on_timer > ret = func(*args, **kwargs) > File "/usr/local/lib/python2.6/dist-packages/matplotlib/animation.py", > line 317, in _step > still_going = Animation._step(self, *args) > File "/usr/local/lib/python2.6/dist-packages/matplotlib/animation.py", > line 179, in _step > self._draw_next_frame(framedata, self._blit) > File "/usr/local/lib/python2.6/dist-packages/matplotlib/animation.py", > line 199, in _draw_next_frame > self._post_draw(framedata, blit) > File "/usr/local/lib/python2.6/dist-packages/matplotlib/animation.py", > line 222, in _post_draw > self._blit_draw(self._drawn_artists, self._blit_cache) > File "/usr/local/lib/python2.6/dist-packages/matplotlib/animation.py", > line 236, in _blit_draw > bg_cache[a.axes] = a.figure.canvas.copy_from_bbox(a.axes.bbox) > AttributeError: QuadContourSet instance has no attribute 'figure' It looks like just one more duck punch is needed; just set im.figure = fig after the setting of im.axes. QuadContourSet should really call a.get_axes() and a.get_figure() instead of using the attributes directly; doing so would allow any object that implements the proper interfaces to work, artist or no. > Is this error occurring because there is no bit-mapped representation of > a contour object? It's not really that, it's just that the animation class expects to be given a list of Artists to work with (the original author can correct me if I'm wrong), and that's not what it is being given, because a QuadContourSet is not an Artist. But you can duck punch it until it acts like one :D IMO, there are quite a few things in matplotlib that are a little inconsistent in this way. -- Daniel Hyams dh...@gm...
On Sun, 2011年11月13日 at 13:26 -0500, Daniel Hyams wrote: > Oops; my sentence should have read "is *not* derived from an artist". Yes, I was wondering about that. I was actually looking though the artist.py and contour.py source code when your message came in. On Sunday, November 13, 2011, Daniel Hyams <dh...@gm...> wrote: > The following monkey patch fixes it in the example script (obviously, > it does not fix the underlying problem; for QuadContourSet to be > usable in this context, it needs to obey the artist interface). > Hopefully, it will be enough to get you up and running. Just add the > four lines between contour call and the appending of the output of > contour() into the list "ims", and also put an "import types" at the > top. OK, types is a new part of the Python library for me, I'll have to go learn about it. It looks like you basically just subclassed the QuadContourSet object through a back door, by giving it the missing method. Your patch solves one of two animation problems, and I offer a suggestion about how to fix the second (with questions). The program gets as far as ani.save() on line 29 without generating any errors. An MP4 file showing animated contours is written to disk. The origin of the contour plot is in the lower left, versus the upper left of the original imshow() call, but that's expected. When you get to plt.show() on line 31, however: Traceback (most recent call last): File "/usr/local/lib/python2.6/dist-packages/matplotlib/backends/backend_gtk.py", line 127, in _on_timer TimerBase._on_timer(self) File "/usr/local/lib/python2.6/dist-packages/matplotlib/backend_bases.py", line 1091, in _on_timer ret = func(*args, **kwargs) File "/usr/local/lib/python2.6/dist-packages/matplotlib/animation.py", line 317, in _step still_going = Animation._step(self, *args) File "/usr/local/lib/python2.6/dist-packages/matplotlib/animation.py", line 179, in _step self._draw_next_frame(framedata, self._blit) File "/usr/local/lib/python2.6/dist-packages/matplotlib/animation.py", line 199, in _draw_next_frame self._post_draw(framedata, blit) File "/usr/local/lib/python2.6/dist-packages/matplotlib/animation.py", line 222, in _post_draw self._blit_draw(self._drawn_artists, self._blit_cache) File "/usr/local/lib/python2.6/dist-packages/matplotlib/animation.py", line 236, in _blit_draw bg_cache[a.axes] = a.figure.canvas.copy_from_bbox(a.axes.bbox) AttributeError: QuadContourSet instance has no attribute 'figure' Since the error was occurring inside blit_draw, I tried altering the animation.ArtistAnimation() call on line 27, letting blit default to False. This resulted in a successful on-screen rendering, as well as a saved file on the disk. Mission accomplished! Though perhaps at the sacrifice of some speed. Is this error occurring because there is no bit-mapped representation of a contour object? If so, what should matplotlib do? Make the user be aware that blit cannot be used with contour objects, as I just learned? Or, alternately, make sure that animations respond intelligently to the objects passed to them? Many thanks again to everyone who is working through this with me!
On Sun, Nov 13, 2011 at 12:57 PM, Jeff Whitaker <js...@fa...> wrote: > > Gökhan: netcdf4-python can read hdf5-eos files, and even hdf4-eos files > if the netcdf C lib is built with hdf4 support. > > -Jeff > I can't build netcdf4 C libraries with HDF4 support. [gsever@ccn hdf-4.2.6]$ ./configure --prefix=/usr/local --includedir=/usr/local/ --with-zlib=/usr/local --with-jpeg=/usr/local --disable-fortran --with-szip=/usr/local/ CFLAGS=-fPIC I can't build HDF4 without disabling the fortran support. Then trying to build netcdf4 with HDF4: [gsever@ccn netcdf-4.1.3]$ ./configure --prefix=/usr/local/netcdf4 --enable-netcdf-4 --with-hdf5=/usr/local/ --enable-shared --enable-hdf4 --with-hdf4=/usr/local/ Fails: Making all in ncgen3 make[2]: Entering directory `/home/gsever/Downloads/netcdf-4.1.3/ncgen3' /bin/sh ../libtool --tag=CC --mode=link gcc -g -O2 -o ncgen3 main.o load.o escapes.o getfill.o init.o genlib.o ncgentab.o ../liblib/libnetcdf.la -lhdf5_hl -lhdf5 -lm -lz -lcurl libtool: link: gcc -g -O2 -o .libs/ncgen3 main.o load.o escapes.o getfill.o init.o genlib.o ncgentab.o ../liblib/.libs/libnetcdf.so -lhdf5_hl -lhdf5 -lm -lz -lcurl -Wl,-rpath -Wl,/usr/local/netcdf4/lib ../liblib/.libs/libnetcdf.so: undefined reference to `SDstart' ../liblib/.libs/libnetcdf.so: undefined reference to `SDend' ../liblib/.libs/libnetcdf.so: undefined reference to `SDattrinfo' ../liblib/.libs/libnetcdf.so: undefined reference to `SDfileinfo' ../liblib/.libs/libnetcdf.so: undefined reference to `SDreadattr' ../liblib/.libs/libnetcdf.so: undefined reference to `SDselect' ../liblib/.libs/libnetcdf.so: undefined reference to `SDreaddata' ../liblib/.libs/libnetcdf.so: undefined reference to `SDdiminfo' ../liblib/.libs/libnetcdf.so: undefined reference to `SDgetfillvalue' ../liblib/.libs/libnetcdf.so: undefined reference to `SDgetinfo' ../liblib/.libs/libnetcdf.so: undefined reference to `SDgetdimid' collect2: ld returned 1 exit status make[2]: *** [ncgen3] Error 1 make[2]: Leaving directory `/home/gsever/Downloads/netcdf-4.1.3/ncgen3' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/home/gsever/Downloads/netcdf-4.1.3' make: *** [all] Error 2 When I remove hdf4 part from config, it builds successfully. Any ideas?
On 11/13/11 12:40 PM, Gökhan Sever wrote: > Hello groups, > > I have two questions about working with MODIS data. > > 1-) Is there any light Pythonic HDF-EOS wrapper to handle HDF-EOS data > other than PyNIO [http://www.pyngl.ucar.edu/Nio.shtml] Although, I > have managed to install that package from its source, it took me many > hours to figure out all the installation quirks. Something simpler to > build and mainly for HDFEOS data?? Gökhan: netcdf4-python can read hdf5-eos files, and even hdf4-eos files if the netcdf C lib is built with hdf4 support. -Jeff > > 2-) Another similar question: Has anybody attempted to create > true-color MODIS images (like the ones shown at > [http://rapidfire.sci.gsfc.nasa.gov/realtime/]) in Python? So far, I > have seen one clear tutorial > [ftp://ftp.ssec.wisc.edu/pub/IMAPP/MODIS/TrueColor/] to create natural > color images, but uses ms2gt [http://nsidc.org/data/modis/ms2gt/], > NDVI and IDL. Except the reflectance correction via NDVI, ms2gt and > IDL parts seem to be implemented in Python. > > Till now, I have some progress combining GOES imagery with aircraft > data. My next task is to combine MODIS data with aircraft and radar > data. I would be happy to get some guidance and code support if there > is any previous work been done using Python. > > Thanks. > > > ------------------------------------------------------------------------------ > RSA(R) Conference 2012 > Save 700ドル by Nov 18 > Register now > http://p.sf.net/sfu/rsa-sfdev2dev1 > > > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Hello groups, I have two questions about working with MODIS data. 1-) Is there any light Pythonic HDF-EOS wrapper to handle HDF-EOS data other than PyNIO [http://www.pyngl.ucar.edu/Nio.shtml] Although, I have managed to install that package from its source, it took me many hours to figure out all the installation quirks. Something simpler to build and mainly for HDFEOS data?? 2-) Another similar question: Has anybody attempted to create true-color MODIS images (like the ones shown at [ http://rapidfire.sci.gsfc.nasa.gov/realtime/]) in Python? So far, I have seen one clear tutorial [ftp://ftp.ssec.wisc.edu/pub/IMAPP/MODIS/TrueColor/] to create natural color images, but uses ms2gt [ http://nsidc.org/data/modis/ms2gt/], NDVI and IDL. Except the reflectance correction via NDVI, ms2gt and IDL parts seem to be implemented in Python. Till now, I have some progress combining GOES imagery with aircraft data. My next task is to combine MODIS data with aircraft and radar data. I would be happy to get some guidance and code support if there is any previous work been done using Python. Thanks.
Greetings. I am interested in accessing Triangulation objections that are created by MPL for tricontour-type plots. The docs for MPL routines that use triangulation objects refer to documentation, but none exists in the MPL online docs. Does anyone have docs/info on using these objects? Having access to them would be great. -dw
Sorry for the very slow reponse time; it's a busy time of the year. Anyway, I've narrowed the problem quite a bit. Here is the kind of situation that causes the issue: import matplotlib.pyplot as plt plt.ion() f1=plt.figure() a1=f1.add_subplot(111) f2=plt.figure() a2=f2.add_subplot(111) a1.plot([0,1]) a2.plot([0,1]) plt.draw() Here, f2 is drawn but f1 only draws the axis object without the line; you must do something else to trigger f1 to draw (e.g. use one of the gui features or make it the current axis, then draw.) The key to recreating this issue is to make the plots in "parallel", that is, make one fig, make another, make one ax, make the other, plot one line, plot the other, etc. This will narrow it down further: I can only recreate this issue on my OS X system; my Ubuntu box does not have this issue. Here's as much info as I can drum up now; let me know what else would be helpful. OS X 10.6.8, Python 2.6.7 (r267:88850, Oct 17 2011, 15:53:34); IPython 0.10.1 (all installed through MacPorts.) MPL 1.1.0 obtained from the MPL website and installed manually (e.g. not through macports); TkAgg backend. Because it's a macports install, it should be a mac Framework install of python. Again, this problem did not manifest until MPL 1.1.0. Thanks for your help. -dw On Sun, Oct 30, 2011 at 10:06 AM, John Hunter <jd...@gm...> wrote: > .draw() > > On Sun, Oct 30, 2011 at 10:51 AM, Daniel Welling <dan...@gm...> > wrote: > > Greetings, MatPlotLibbers. > > > > Since 1.1, pyplot.draw() in interactive mode only updates the current > axis. > > If I want to update many axes, I need to use sca() and draw() for each > one. > > Is there a way to update all axes? > > I'm not seeing this, and I'm not sure *why* it would be occurring for > you. plt.draw triggers a call to fig.canvas.draw which calls draw on > all axes. Here is some example code in ipython, which has 'ion". > > In [2]: fig, axes = plt.subplots(2) > > In [3]: axes[0].plot([1,2,3]) > Out[3]: [<matplotlib.lines.Line2D at 0x4b90550>] > > In [4]: axes[1].plot([1,2,3]) > Out[4]: [<matplotlib.lines.Line2D at 0x4b90610>] > > In [5]: plt.draw() > > > The call to 'plt.draw' on line 5 triggers a draw to both axes. Can > you provide an example which exposes your problem? Please also > provide backend and OS information > > In [6]: !uname -a > Linux pinchiepie 3.0.0-12-generic #20-Ubuntu SMP Fri Oct 7 14:56:25 > UTC 2011 x86_64 x86_64 x86_64 GNU/Linux > > In [7]: import matplotlib; print matplotlib.__version__ > 1.2.x > > In [8]: matplotlib.rcParams['backend'] > Out[8]: 'WXAgg' > > > JDH >
Oops; my sentence should have read "is *not* derived from an artist". On Sun, Nov 13, 2011 at 1:24 PM, Benjamin Root <ben...@ou...> wrote: > > > On Sunday, November 13, 2011, Daniel Hyams <dh...@gm...> wrote: >> This looks like a bug in matplotlib to me; I get the same thing. >> >> The basic issue is that QuadContourSet is derived from an artist, and >> so does not have all of the artist methods; the animation framework >> depends on the things that it is animating being artists. >> >> The following monkey patch fixes it in the example script (obviously, >> it does not fix the underlying problem; for QuadContourSet to be >> usable in this context, it needs to obey the artist interface). >> Hopefully, it will be enough to get you up and running. Just add the >> four lines between contour call and the appending of the output of >> contour() into the list "ims", and also put an "import types" at the >> top. >> >> >> #!/usr/bin/env python >> """ >> An animated image >> """ >> import numpy as np >> import matplotlib.pyplot as plt >> import matplotlib.animation as animation >> import types >> fig = plt.figure() >> def f(x, y): >> return np.sin(x) + np.cos(y) >> x = np.linspace(0, 2 * np.pi, 120) >> y = np.linspace(0, 2 * np.pi, 100).reshape(-1, 1) >> # ims is a list of lists, each row is a list of artists to draw in the >> # current frame; here we are just animating one artist, the image, in >> # each frame >> ims = [] >> for i in range(60): >> x += np.pi / 15. >> y += np.pi / 20. >> im = plt.contour(f(x, y)) >> def setvisible(self,vis): >> for c in self.collections: c.set_visible(vis) >> im.set_visible = types.MethodType(setvisible,im,None) >> im.axes = plt.gca() >> ims.append([im]) >> ani = animation.ArtistAnimation(fig, ims, interval=50, blit=True, >> repeat_delay=1000) >> ani.save('dynamic_images.mp4') >> >> plt.show() >> > > Technically speaking, it is derived from ScalarMappable, not Artist. It is > counter-intuitive, though. > > Ben Root -- Daniel Hyams dh...@gm...
On Sunday, November 13, 2011, Daniel Hyams <dh...@gm...> wrote: > This looks like a bug in matplotlib to me; I get the same thing. > > The basic issue is that QuadContourSet is derived from an artist, and > so does not have all of the artist methods; the animation framework > depends on the things that it is animating being artists. > > The following monkey patch fixes it in the example script (obviously, > it does not fix the underlying problem; for QuadContourSet to be > usable in this context, it needs to obey the artist interface). > Hopefully, it will be enough to get you up and running. Just add the > four lines between contour call and the appending of the output of > contour() into the list "ims", and also put an "import types" at the > top. > > > #!/usr/bin/env python > """ > An animated image > """ > import numpy as np > import matplotlib.pyplot as plt > import matplotlib.animation as animation > import types > fig = plt.figure() > def f(x, y): > return np.sin(x) + np.cos(y) > x = np.linspace(0, 2 * np.pi, 120) > y = np.linspace(0, 2 * np.pi, 100).reshape(-1, 1) > # ims is a list of lists, each row is a list of artists to draw in the > # current frame; here we are just animating one artist, the image, in > # each frame > ims = [] > for i in range(60): > x += np.pi / 15. > y += np.pi / 20. > im = plt.contour(f(x, y)) > def setvisible(self,vis): > for c in self.collections: c.set_visible(vis) > im.set_visible = types.MethodType(setvisible,im,None) > im.axes = plt.gca() > ims.append([im]) > ani = animation.ArtistAnimation(fig, ims, interval=50, blit=True, > repeat_delay=1000) > ani.save('dynamic_images.mp4') > > plt.show() > Technically speaking, it is derived from ScalarMappable, not Artist. It is counter-intuitive, though. Ben Root
This looks like a bug in matplotlib to me; I get the same thing. The basic issue is that QuadContourSet is derived from an artist, and so does not have all of the artist methods; the animation framework depends on the things that it is animating being artists. The following monkey patch fixes it in the example script (obviously, it does not fix the underlying problem; for QuadContourSet to be usable in this context, it needs to obey the artist interface). Hopefully, it will be enough to get you up and running. Just add the four lines between contour call and the appending of the output of contour() into the list "ims", and also put an "import types" at the top. #!/usr/bin/env python """ An animated image """ import numpy as np import matplotlib.pyplot as plt import matplotlib.animation as animation import types fig = plt.figure() def f(x, y): return np.sin(x) + np.cos(y) x = np.linspace(0, 2 * np.pi, 120) y = np.linspace(0, 2 * np.pi, 100).reshape(-1, 1) # ims is a list of lists, each row is a list of artists to draw in the # current frame; here we are just animating one artist, the image, in # each frame ims = [] for i in range(60): x += np.pi / 15. y += np.pi / 20. im = plt.contour(f(x, y)) def setvisible(self,vis): for c in self.collections: c.set_visible(vis) im.set_visible = types.MethodType(setvisible,im,None) im.axes = plt.gca() ims.append([im]) ani = animation.ArtistAnimation(fig, ims, interval=50, blit=True, repeat_delay=1000) ani.save('dynamic_images.mp4') plt.show()
On 11/13/2011 8:38 AM, Rahul Mahajan wrote: > Hi, > > Is there such a thing "Python / Matplotlib Central Exchange" similar to > the "File Exchange on Matlab Central" ( > http://www.mathworks.com/matlabcentral/fileexchange/ ) that anyone is > aware of which allows one to search for user-contributed functions / > packages. > > Many Thanks! > > http://scipy-central.org/ "A collection of code snippets, modules and links for solving scientific problems with SciPy and related Python tools." Christoph
In my last post I said that upgrading Numpy to 1.6.1 restored function to Matplotlib 1.1.0. Well, I spoke a bit too soon. Static contour plots appear to work fine, but they don't play nicely with the new animation methods. This animation example runs without errors. http://matplotlib.sourceforge.net/examples/animation/dynamic_image2.html But change line 23 from this: im = plt.imshow(f(x, y)) to this: im = plt.contour(f(x, y)) and you get this: Traceback (most recent call last): File "dynamic_image2.py", line 27, in <module> repeat_delay=1000) File "/usr/local/lib/python2.6/dist-packages/matplotlib/animation.py", line 358, in __init__ TimedAnimation.__init__(self, fig, *args, **kwargs) File "/usr/local/lib/python2.6/dist-packages/matplotlib/animation.py", line 306, in __init__ Animation.__init__(self, fig, event_source=event_source, *args, **kwargs) File "/usr/local/lib/python2.6/dist-packages/matplotlib/animation.py", line 55, in __init__ self._init_draw() File "/usr/local/lib/python2.6/dist-packages/matplotlib/animation.py", line 365, in _init_draw artist.set_visible(False) AttributeError: QuadContourSet instance has no attribute 'set_visible' Is this a Matplotlib bug, or am I still tracking down some package dependency issue?
Hi, Is there such a thing "Python / Matplotlib Central Exchange" similar to the "File Exchange on Matlab Central" ( http://www.mathworks.com/matlabcentral/fileexchange/ ) that anyone is aware of which allows one to search for user-contributed functions / packages. Many Thanks!
Just to follow up: I can now report that removing numpy 1.3.0 and installing 1.6.1 corrected the problems with image and contour plots in my configuration. Thanks to everyone for their input.
Hi Ben and John, > The doc page is wrong. There was suspicions of this recently with > nextafter(), but no one knew when it was introduced in numpy. Now we know > and I will update the page accordingly. I ran into the same problem recently and discovered that nextafter() was introduced in numpy 1.4.0. L.
I meant to send this to the list yesterday, but I just noticed I sent it only to Ben. For completeness, here it is... ---------- Forwarded message ---------- From: Warren Weckesser <war...@en...> Date: Sat, Nov 12, 2011 at 8:45 PM Subject: Re: [Matplotlib-users] Upgraded to 1.1.0, now only line graphs work! To: Benjamin Root <ben...@ou...> On Sat, Nov 12, 2011 at 8:03 PM, Benjamin Root <ben...@ou...> wrote: > > > On Saturday, November 12, 2011, John Ladasky <joh...@sb...> > wrote: > > Two days ago I posted some questions about upgrading, and was pointed to > > the right resources by some readers who replied to me privately > > (thanks!). I am running Python 2.6 on an Ubuntu Linux 10.10 platform. > > The upgrade appeared to build successfully, but I still have problems. > > > > Line graphs appear to be working all right, but images and contour > > graphs generate errors, and fail to draw. > > > > > > My procedure: > > > > I deleted every last old matplotlib-related file from my hard disk,from > > both my Python dist-packages directory and from my home directory. I > > got my build dependencies up to date, and installed using git as > > described here: > > > > > http://matplotlib.sourceforge.net/faq/installing_faq.html#install-from-git > > > > > > The three-line simple_plot.py script suggested here... > > > > http://matplotlib.sourceforge.net/faq/installing_faq.html > > > > ...runs, displays a line graph, and outputs the following when run with > > the flag --verbose-helpful: > > > > 17:26:42 -> python simple_plot.py --verbose-helpful > > $HOME=/home/john > > CONFIGDIR=/home/john/.matplotlib > > matplotlib data > > path /usr/local/lib/python2.6/dist-packages/matplotlib/mpl-data > > loaded rc > > file > /usr/local/lib/python2.6/dist-packages/matplotlib/mpl-data/matplotlibrc > > matplotlib version 1.2.x > > verbose.level helpful > > interactive is False > > platform is linux2 > > Using fontManager instance from /home/john/.matplotlib/fontList.cache > > backend GTKAgg version 2.21.0 > > findfont: > > Matching > :family=sans-serif:style=normal:variant=normal:weight=normal:stretch=normal:size=medium > to Bitstream Vera Sans > (/usr/local/lib/python2.6/dist-packages/matplotlib/mpl-data/fonts/ttf/Vera.ttf) > with score of 0.000000 > > > > > > Now, here's a very simple script of mine, which should draw a figure > > with a colored bulls-eye: > > > > from numpy import exp, fromfunction, hypot > > import matplotlib.pyplot as plt > > > > def func(x, y): > > return exp(-hypot(x-50,y-50) / 20) > > > > fig = plt.figure() > > ax = plt.subplot(111) > > arr = fromfunction(func, (101,101)) > > img = plt.imshow(arr) > > plt.show() > > > > > > Instead, it draws an empty figure, and returns a long and > > apparently-repeated traceback, which I hesitate to post in its entirety. > > Here's the last repeat. I believe that I got this eight times in a row: > > > > Traceback (most recent call last): > > File > > > "/usr/local/lib/python2.6/dist-packages/matplotlib/backends/backend_gtk.py", > line 418, in expose_event > > self._render_figure(self._pixmap, w, h) > > File > > > "/usr/local/lib/python2.6/dist-packages/matplotlib/backends/backend_gtkagg.py", > line 75, in _render_figure > > FigureCanvasAgg.draw(self) > > File > > > "/usr/local/lib/python2.6/dist-packages/matplotlib/backends/backend_agg.py", > line 400, in draw > > self.figure.draw(self.renderer) > > File "/usr/local/lib/python2.6/dist-packages/matplotlib/artist.py", > > line 55, in draw_wrapper > > draw(artist, renderer, *args, **kwargs) > > File "/usr/local/lib/python2.6/dist-packages/matplotlib/figure.py", > > line 886, in draw > > func(*args) > > File "/usr/local/lib/python2.6/dist-packages/matplotlib/artist.py", > > line 55, in draw_wrapper > > draw(artist, renderer, *args, **kwargs) > > File "/usr/local/lib/python2.6/dist-packages/matplotlib/axes.py", line > > 1983, in draw > > a.draw(renderer) > > File "/usr/local/lib/python2.6/dist-packages/matplotlib/artist.py", > > line 55, in draw_wrapper > > draw(artist, renderer, *args, **kwargs) > > File "/usr/local/lib/python2.6/dist-packages/matplotlib/image.py", > > line 356, in draw > > im = self.make_image(renderer.get_image_magnification()) > > File "/usr/local/lib/python2.6/dist-packages/matplotlib/image.py", > > line 576, in make_image > > transformed_viewLim) > > File "/usr/local/lib/python2.6/dist-packages/matplotlib/image.py", > > line 202, in _get_unsampled_image > > x = self.to_rgba(self._A, bytes=True) > > File "/usr/local/lib/python2.6/dist-packages/matplotlib/cm.py", line > > 215, in to_rgba > > x = self.cmap(x, alpha=alpha, bytes=bytes) > > File "/usr/local/lib/python2.6/dist-packages/matplotlib/colors.py", > > line 521, in __call__ > > cbook._putmask(xa, xa==1.0, np.nextafter(xa.dtype.type(1), > > AttributeError: 'module' object has no attribute 'nextafter' > > > > > > Programs which invoke contour() instead of imshow() fail similarly. I > > downloaded the 1.1.0 animation examples (my whole reason for upgrading > > was to use the new animation methods), and only the line-graph examples > > work. > > > > > > As suggested (on a page I can't quite track down now), I captured a log > > of the build and install commands. The words "error" or "warning" do > > not show up in either of those logs -- and I did get several warnings > > when building 0.99 and 1.0.1, so I feel like things ought to be working > > better this time, not worse... > > > > Thanks for any hints! > > > > > > Looks like mpl truly can't be used with older version of numpy. Which > version are you using? > > The version of numpy in Ubuntu 10.10 is 1.3, but the 'nextafter' function was added to numpy in version 1.4. This page: http://matplotlib.sourceforge.net/users/installing.html says "matplotlib requires numpy version 1.1 or later", so either that page is incorrect, or a newer feature of numpy has been used in the matplotlib code unintentionally. Warren Ben Root > > > > ------------------------------------------------------------------------------ > RSA(R) Conference 2012 > Save 700ドル by Nov 18 > Register now > http://p.sf.net/sfu/rsa-sfdev2dev1 > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > >
2011年11月7日 Anton Daitche <a.d...@go...>: > Do you remember the name of the thread? I would like to understand the > details on this. I can't find it right now but I guess Michael's answer helps you. > I also would like to find out if i can force the renderer to do exact > drawing (at some computational cost). Do you mean using an interactive backend? You can try gtkcairo and wx. I think they have their own issues though. Goyo
Hi everyone, can someone please help me how to make a plot like this: http://tutorial.math.lamar.edu/Classes/DE/PhasePlane_files/image002.gif The main issue with it is in the (black) trajectories. As far as i know there is no function in matplotlib to plot trajectories with arrows pointing in a direction. But I think a good workaround is: plotting the trajectories with plot(..) and use quiver(..) at certain points to get an arrows. A minimal example would be: import matplotlib.pyplot as plt import numpy as np import scipy.integrate as integrate if __name__=="__main__": t = np.linspace(0, 20, 1000) l = 3 # some starting points X0s = [[-3.0, 0], [-3.0, -1], [-3.0, -2], [-2, -3.0], [-1, -3.0], [0, -3.0], [1, -3.0], [2, -3.0], [3.0, -2], [3.0, -1], [3.0, 0.0], [3.0, 1], [3.0, 2], [2, 3.0], [1, 3.0], [0, 3.0], [-1, 3.0], [-2, 3.0], [-3.0, 2], [-3.0, 1], [0, 0.01], [0, -0.01], [0.01, 0], [-0.01, 0]] sattel = lambda x,t=0: [-x[0], x[1]] plt.axis([-l,l,-l,l]) for X0 in X0s: state = integrate.odeint(sattel, X0, t).T plt.plot(*state, color="k", linewidth=1) xs = state[:,::10] x_ds = np.asarray(sattel(xs)) M = np.hypot(x_ds[0],x_ds[1]) plt.quiver(xs[0],xs[1],x_ds[0]/M,x_ds[1]/M, pivot="mid")#,scale=100, scale_units="width",linewidth=5) plt.axis([-l,l,-l,l]) plt.show() That is pretty much what I was looking for except the shafts of the arrows that I can't get rid off. You can see what I tried to get this done by uncomment the quiver parameter. Doing this, you can see, the shafts are (nearly) gone, but the arrows look horrible. I wonder if there is anyway to tell quiver(..) to only plot the heads of the arrow, without the shaft. Can you please give me a hint how to do this? Thank you, Andy Matplotlib version: 1.0.1 Installed as: Ubuntu package OS: Ubuntu 11.10
2011年11月12日 Friedrich Romstedt <fri...@gm...>: > This is my summary of what I found out. Some small follow-up regarding what might trigger the bug: http://comments.gmane.org/gmane.comp.python.matplotlib.general/1115 is a report by Chris Barker indicating as a side-effect that NISC18030.ttf was present even in 2005. It "could not be loaded" that time. I.e. it didn't cause a Bus error. That it was attempted to be loaded indicates that the fontcache was to be rebuilt that time, so the file must be present. http://code.google.com/p/anki/issues/detail?id=560 indicates that, in 2008, on a 10.5 OS X the file could "not be loaded" too. Again, just the attempt implies that the fontcache was rebuilt. So the file must be present, except if the font_manager.py logic of early 2009 is the result of a dramatic change since then. It appears very probable that the Bus error is not triggered on 10.5, but only on 10.6, when building with MACOSX_DEPLOYMENT_TARGET=10.5. It remains unclear starting from which patch version of 10.6 it appears, and also if it is a gcc-4.2 only issue. In the case it is gcc-4.2 related, it would explain the rarity, because gcc-4.2 was introduced in 10.6, so who would build with 10.5 deployment target? If 10.5 is targeted, you mostly need to use gcc-4.0 anyway. (This is something I overlooked myself for my own decision until now.) Friedrich
On Saturday, November 12, 2011, John Ladasky <joh...@sb...> wrote: > On Sat, 2011年11月12日 at 20:08 -0600, Warren Weckesser wrote: > >> By any chance do you have a file called 'numpy.py' in the directory >> where you ran this? If so, rename that file and try again. > > Hi, Warren, > > No, there is no file named "numpy.py" in the directory with my test > programs, or anywhere on my file system, for that matter. > > > > And here's a question that I've received off the list-serv, which the > author CC'ed to the list and thus should appear here soon: > > On Sat, 2011年11月12日 at 20:03 -0600, Benjamin Root wrote: > >> Looks like mpl truly can't be used with older version of numpy. Which > version are you using? >> >> Ben Root > > Hi Ben, > > Well, you made me look. My numpy version is a few revisions behind. I > have 1.3.0, and they're up to 1.6.1, which I just downloaded. Still, > this page... > > http://matplotlib.sourceforge.net/users/installing.html#build-requirements > > ...says that numpy 1.1 or later should work. > > > > Thanks to you both for your suggestions, I hope to figure this out. > > The doc page is wrong. There was suspicions of this recently with nextafter(), but no one knew when it was introduced in numpy. Now we know and I will update the page accordingly. Ben Root
On Sat, 2011年11月12日 at 20:08 -0600, Warren Weckesser wrote: > By any chance do you have a file called 'numpy.py' in the directory > where you ran this? If so, rename that file and try again. Hi, Warren, No, there is no file named "numpy.py" in the directory with my test programs, or anywhere on my file system, for that matter. And here's a question that I've received off the list-serv, which the author CC'ed to the list and thus should appear here soon: On Sat, 2011年11月12日 at 20:03 -0600, Benjamin Root wrote: > Looks like mpl truly can't be used with older version of numpy. Which version are you using? > > Ben Root Hi Ben, Well, you made me look. My numpy version is a few revisions behind. I have 1.3.0, and they're up to 1.6.1, which I just downloaded. Still, this page... http://matplotlib.sourceforge.net/users/installing.html#build-requirements ...says that numpy 1.1 or later should work. Thanks to you both for your suggestions, I hope to figure this out.
On Saturday, November 12, 2011, John Ladasky <joh...@sb...> wrote: > Two days ago I posted some questions about upgrading, and was pointed to > the right resources by some readers who replied to me privately > (thanks!). I am running Python 2.6 on an Ubuntu Linux 10.10 platform. > The upgrade appeared to build successfully, but I still have problems. > > Line graphs appear to be working all right, but images and contour > graphs generate errors, and fail to draw. > > > My procedure: > > I deleted every last old matplotlib-related file from my hard disk,from > both my Python dist-packages directory and from my home directory. I > got my build dependencies up to date, and installed using git as > described here: > > http://matplotlib.sourceforge.net/faq/installing_faq.html#install-from-git > > > The three-line simple_plot.py script suggested here... > > http://matplotlib.sourceforge.net/faq/installing_faq.html > > ...runs, displays a line graph, and outputs the following when run with > the flag --verbose-helpful: > > 17:26:42 -> python simple_plot.py --verbose-helpful > $HOME=/home/john > CONFIGDIR=/home/john/.matplotlib > matplotlib data > path /usr/local/lib/python2.6/dist-packages/matplotlib/mpl-data > loaded rc > file /usr/local/lib/python2.6/dist-packages/matplotlib/mpl-data/matplotlibrc > matplotlib version 1.2.x > verbose.level helpful > interactive is False > platform is linux2 > Using fontManager instance from /home/john/.matplotlib/fontList.cache > backend GTKAgg version 2.21.0 > findfont: > Matching :family=sans-serif:style=normal:variant=normal:weight=normal:stretch=normal:size=medium to Bitstream Vera Sans (/usr/local/lib/python2.6/dist-packages/matplotlib/mpl-data/fonts/ttf/Vera.ttf) with score of 0.000000 > > > Now, here's a very simple script of mine, which should draw a figure > with a colored bulls-eye: > > from numpy import exp, fromfunction, hypot > import matplotlib.pyplot as plt > > def func(x, y): > return exp(-hypot(x-50,y-50) / 20) > > fig = plt.figure() > ax = plt.subplot(111) > arr = fromfunction(func, (101,101)) > img = plt.imshow(arr) > plt.show() > > > Instead, it draws an empty figure, and returns a long and > apparently-repeated traceback, which I hesitate to post in its entirety. > Here's the last repeat. I believe that I got this eight times in a row: > > Traceback (most recent call last): > File > "/usr/local/lib/python2.6/dist-packages/matplotlib/backends/backend_gtk.py", line 418, in expose_event > self._render_figure(self._pixmap, w, h) > File > "/usr/local/lib/python2.6/dist-packages/matplotlib/backends/backend_gtkagg.py", line 75, in _render_figure > FigureCanvasAgg.draw(self) > File > "/usr/local/lib/python2.6/dist-packages/matplotlib/backends/backend_agg.py", line 400, in draw > self.figure.draw(self.renderer) > File "/usr/local/lib/python2.6/dist-packages/matplotlib/artist.py", > line 55, in draw_wrapper > draw(artist, renderer, *args, **kwargs) > File "/usr/local/lib/python2.6/dist-packages/matplotlib/figure.py", > line 886, in draw > func(*args) > File "/usr/local/lib/python2.6/dist-packages/matplotlib/artist.py", > line 55, in draw_wrapper > draw(artist, renderer, *args, **kwargs) > File "/usr/local/lib/python2.6/dist-packages/matplotlib/axes.py", line > 1983, in draw > a.draw(renderer) > File "/usr/local/lib/python2.6/dist-packages/matplotlib/artist.py", > line 55, in draw_wrapper > draw(artist, renderer, *args, **kwargs) > File "/usr/local/lib/python2.6/dist-packages/matplotlib/image.py", > line 356, in draw > im = self.make_image(renderer.get_image_magnification()) > File "/usr/local/lib/python2.6/dist-packages/matplotlib/image.py", > line 576, in make_image > transformed_viewLim) > File "/usr/local/lib/python2.6/dist-packages/matplotlib/image.py", > line 202, in _get_unsampled_image > x = self.to_rgba(self._A, bytes=True) > File "/usr/local/lib/python2.6/dist-packages/matplotlib/cm.py", line > 215, in to_rgba > x = self.cmap(x, alpha=alpha, bytes=bytes) > File "/usr/local/lib/python2.6/dist-packages/matplotlib/colors.py", > line 521, in __call__ > cbook._putmask(xa, xa==1.0, np.nextafter(xa.dtype.type(1), > AttributeError: 'module' object has no attribute 'nextafter' > > > Programs which invoke contour() instead of imshow() fail similarly. I > downloaded the 1.1.0 animation examples (my whole reason for upgrading > was to use the new animation methods), and only the line-graph examples > work. > > > As suggested (on a page I can't quite track down now), I captured a log > of the build and install commands. The words "error" or "warning" do > not show up in either of those logs -- and I did get several warnings > when building 0.99 and 1.0.1, so I feel like things ought to be working > better this time, not worse... > > Thanks for any hints! > > Looks like mpl truly can't be used with older version of numpy. Which version are you using? Ben Root