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
(1) |
2
(4) |
3
(12) |
4
(5) |
5
(30) |
6
(21) |
7
(20) |
8
(11) |
9
(9) |
10
(12) |
11
(11) |
12
(22) |
13
(22) |
14
(38) |
15
(25) |
16
(23) |
17
(20) |
18
(7) |
19
(13) |
20
(13) |
21
(18) |
22
(6) |
23
(7) |
24
(4) |
25
(9) |
26
(35) |
27
(37) |
28
(22) |
29
(27) |
30
(12) |
31
(4) |
Thanks John, That shows how long it is since I used line markers in my plots. Because I use them so infrequently, I'm probably not the best one to suggest it, but I think it would be nicer for the default colour to match the line colour by default, or for an option to be added to allow its simple selection without users having to search through the mailing list to find Norbert's solution. If I was publishing a colour plot with line markers I would definitely want to do this. Gary John Hunter wrote: > On Mon, Jan 26, 2009 at 6:17 AM, Gary Ruben wrote: >> Has the mec always been black? I thought it used to be the same as the >> line colour. I expected it to default to the line colour, as Che expected. > > It's been this way since at least 2004: > > http://matplotlib.svn.sourceforge.net/viewvc/matplotlib/trunk/matplotlib/lib/matplotlib/__init__.py?revision=540&view=markup > > JDH
John Hunter wrote: > On Mon, Jan 26, 2009 at 2:14 PM, Nick Matzke <ma...@be...> wrote: > >> Hi Mauro, >> >> Update: >> >> 1. I went to the place that threw an error in the basemap code: >> >> >> >> "/Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/basemap-0.99.1.0001-py2.5-macosx-10.3-fat.egg/mpl_toolkits/basemap/__init__.py", >> >> >> line 2501, in set_axes_limits >> >> figManager.canvas.draw() >> >> AttributeError: 'NoneType' object has no attribute 'canvas' >> >> >> >> >> >> >> The code is: >> >> ============ >> # force draw if in interactive mode. >> if is_interactive(): >> figManager = _pylab_helpers.Gcf.get_active() >> figManager.canvas.draw() >> ============ >> >> >> So, I changed "interactive = true" to "interactive = false" in my >> matplotlibrc file. >> > > Croizat is calling pylab here via basemap, which is a bug. Croizat is > a wx app, and should never import pylab or pyplot. This is happening > somewhere in basemap, most likely a call to basemap is not passing in > an axes or figure instance in. When basemap gets a default axes > instance of None, it imports pyplot and creates its own. I have no > idea why this is happening on one platform and not another for > Croizat, but this is where the bug is occurring most likely. > > A good way to track this down is to remove matplotlib/pyplot.py from > site-packages and rerun. The stack trace should show you which > Croizat/basemap call is triggering the import, and you can fix it > there. The fix you are trying is dangerous, unsupported, and likely > to fail in unpredicatable ways. > > JDH > > I think the problem could be solved by having the app explicity set interactive to false (using matplotlib.interactive(False)), instead of letting the users matplotlibrc determine it. From a cursory look at the code, it looks like the app is not letting basemap create it's own axes instance with pyplot. It's just that if basemap finds that is_interactive is True, it will use pyplot for force the canvas to be drawn. -Jeff ---- Jeffrey S. Whitaker Phone : (303)497-6313 Meteorologist FAX : (303)497-6449 NOAA/OAR/PSD R/PSD1 Email : Jef...@no... 325 Broadway Office : Skaggs Research Cntr 1D-113 Boulder, CO, USA 80303-3328 Web : http://tinyurl.com/5telg
On Mon, Jan 26, 2009 at 2:14 PM, Nick Matzke <ma...@be...> wrote: > Hi Mauro, > > Update: > > 1. I went to the place that threw an error in the basemap code: > > >> > "/Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/basemap-0.99.1.0001-py2.5-macosx-10.3-fat.egg/mpl_toolkits/basemap/__init__.py", > > >> line 2501, in set_axes_limits > >> figManager.canvas.draw() > >> AttributeError: 'NoneType' object has no attribute 'canvas' > >> > >> > > > The code is: > > ============ > # force draw if in interactive mode. > if is_interactive(): > figManager = _pylab_helpers.Gcf.get_active() > figManager.canvas.draw() > ============ > > > So, I changed "interactive = true" to "interactive = false" in my > matplotlibrc file. Croizat is calling pylab here via basemap, which is a bug. Croizat is a wx app, and should never import pylab or pyplot. This is happening somewhere in basemap, most likely a call to basemap is not passing in an axes or figure instance in. When basemap gets a default axes instance of None, it imports pyplot and creates its own. I have no idea why this is happening on one platform and not another for Croizat, but this is where the bug is occurring most likely. A good way to track this down is to remove matplotlib/pyplot.py from site-packages and rerun. The stack trace should show you which Croizat/basemap call is triggering the import, and you can fix it there. The fix you are trying is dangerous, unsupported, and likely to fail in unpredicatable ways. JDH
Hi Mauro, Update: 1. I went to the place that threw an error in the basemap code: >> "/Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/basemap-0.99.1.0001-py2.5-macosx-10.3-fat.egg/mpl_toolkits/basemap/__init__.py", >> line 2501, in set_axes_limits >> figManager.canvas.draw() >> AttributeError: 'NoneType' object has no attribute 'canvas' >> >> The code is: ============ # force draw if in interactive mode. if is_interactive(): figManager = _pylab_helpers.Gcf.get_active() figManager.canvas.draw() ============ So, I changed "interactive = true" to "interactive = false" in my matplotlibrc file. Now when I run "python Croizat.py", I get no error messages, and the graphic of a world map comes up. I can get rivers etc. to display correctly. 2. However, I tried opening the America.prj project file, and the various *.csv files in the /samples directory, and couldn't get anything to display (perhaps because interactive mode is off?). When I clicked on the the various analysis options (e.g. track analysis), I get "Number of data files must be >= 1". This probably means the files aren't actually loading... 2a. Workaround: When I copied the *.prj file and the *.csv files from Croizat/sample to the main Croizat directory, then I was able to open things fine, and run the analyses. So basically it looks like it works now. Recommend you post this where appropriate for other users. Cheers! Nick Nick Matzke wrote: > Hi Mauro & Lionel, > > I tried changing the backend to WX (and WxAgg) via the matplotlibrc > file, but got the same result. Other suggestions welcome! > > Nick > > > WX: > ================== > mws2:/bioinformatics/croizat/Croizat nick$ py Croizat.py > > > matplotlib data path > /Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/matplotlib-0.98.3.0001-py2.5-macosx-10.3-fat.egg/matplotlib/mpl-data > > loaded rc file /Users/nick/.matplotlib/matplotlibrc > matplotlib version 0.98.3 > verbose.level helpful > interactive is True > units is False > platform is darwin > numerix numpy 1.1.1 > $HOME=/Users/nick > CONFIGDIR=/Users/nick/.matplotlib > Using fontManager instance from /Users/nick/.matplotlib/fontManager.cache > backend WX version 2.8.7.1 > Traceback (most recent call last): > File "Croizat.py", line 71, in <module> > Croizat = Application(0) > File > "/Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/wxPython-2.8.7.1.0003_s-py2.5-macosx-10.3-fat.egg/wx/_core.py", > line 7836, in __init__ > self._BootstrapApp() > File > "/Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/wxPython-2.8.7.1.0003_s-py2.5-macosx-10.3-fat.egg/wx/_core.py", > line 7433, in _BootstrapApp > return _core_.PyApp__BootstrapApp(*args, **kwargs) > File "Croizat.py", line 62, in OnInit > MainWindow = MainForm(None, -1, "") > File "/home/maurobio/Projetos/Croizat/source/MainForm.py", line 201, > in __init__ > File "/home/maurobio/Projetos/Croizat/source/MainForm.py", line 320, > in __do_layout > File "/home/maurobio/Projetos/Croizat/source/MainForm.py", line 1187, > in DrawMap > File > "/Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/basemap-0.99.1.0001-py2.5-macosx-10.3-fat.egg/mpl_toolkits/basemap/__init__.py", > line 1361, in drawcoastlines > self.set_axes_limits(ax=ax) > File > "/Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/basemap-0.99.1.0001-py2.5-macosx-10.3-fat.egg/mpl_toolkits/basemap/__init__.py", > line 2501, in set_axes_limits > figManager.canvas.draw() > AttributeError: 'NoneType' object has no attribute 'canvas' > ================== > > > WxAgg: > =================== > mws2:/bioinformatics/croizat/Croizat nick$ py Croizat.py > > > matplotlib data path > /Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/matplotlib-0.98.3.0001-py2.5-macosx-10.3-fat.egg/matplotlib/mpl-data > > loaded rc file /Users/nick/.matplotlib/matplotlibrc > matplotlib version 0.98.3 > verbose.level helpful > interactive is True > units is False > platform is darwin > numerix numpy 1.1.1 > $HOME=/Users/nick > CONFIGDIR=/Users/nick/.matplotlib > Using fontManager instance from /Users/nick/.matplotlib/fontManager.cache > backend WXAgg version 2.8.7.1 > Traceback (most recent call last): > File "Croizat.py", line 71, in <module> > Croizat = Application(0) > File > "/Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/wxPython-2.8.7.1.0003_s-py2.5-macosx-10.3-fat.egg/wx/_core.py", > line 7836, in __init__ > self._BootstrapApp() > File > "/Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/wxPython-2.8.7.1.0003_s-py2.5-macosx-10.3-fat.egg/wx/_core.py", > line 7433, in _BootstrapApp > return _core_.PyApp__BootstrapApp(*args, **kwargs) > File "Croizat.py", line 62, in OnInit > MainWindow = MainForm(None, -1, "") > File "/home/maurobio/Projetos/Croizat/source/MainForm.py", line 201, > in __init__ > File "/home/maurobio/Projetos/Croizat/source/MainForm.py", line 320, > in __do_layout > File "/home/maurobio/Projetos/Croizat/source/MainForm.py", line 1187, > in DrawMap > File > "/Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/basemap-0.99.1.0001-py2.5-macosx-10.3-fat.egg/mpl_toolkits/basemap/__init__.py", > line 1361, in drawcoastlines > self.set_axes_limits(ax=ax) > File > "/Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/basemap-0.99.1.0001-py2.5-macosx-10.3-fat.egg/mpl_toolkits/basemap/__init__.py", > line 2501, in set_axes_limits > figManager.canvas.draw() > AttributeError: 'NoneType' object has no attribute 'canvas' > > > mws2:/bioinformatics/croizat/Croizat nick$ > =================== > > > > > Mauro Cavalcanti wrote: >> Dear Nick, >> >> I got this reply from one of the members of the Matplotlib-users >> discussion list. I don't know if it will help, but maybe a start. >> >> Another suggestion I may give you just occurred me yesterday: try >> deleting all the .pyc files included in the "Croizat" distribution >> archive, then go to the /source sub-folder of the installation folder >> and run the Croizat.py file from there. The Python interpreter will >> recompile the code and rebuild the .pyc files in the source folder. >> Maybe this will help. Anyway, let me know the results. >> >> With warmest regards, >> >> >> ---------- Forwarded message ---------- >> From: Lionel Roubeyrie <lro...@li...> >> Date: 2009年1月22日 >> Subject: Re: [Matplotlib-users] Fwd: Croizat on Mac OS X >> To: Matplotlib Users <mat...@li...> >> >> >> Maybe a backend problem, since your soft is based on wx and the user >> uses Tk : >> ... >>> Using fontManager instance from >>> /Users/nick/.matplotlib/fontManager.cache >>> backend TkAgg version 8.4 >>> Traceback (most recent call last): >>> File "Croizat.py", line 71, in <module> >>> Croizat = Application(0) >> ... >> -- >> Lionel Roubeyrie >> chargé d'études >> LIMAIR - La Surveillance de l'Air en Limousin >> http://www.limair.asso.fr >> >> >> >> ------------------------------------------------------------------------------ >> >> This SF.net email is sponsored by: >> SourcForge Community >> SourceForge wants to tell your story. >> http://p.sf.net/sfu/sf-spreadtheword >> _______________________________________________ >> Matplotlib-users mailing list >> Mat...@li... >> https://lists.sourceforge.net/lists/listinfo/matplotlib-users >> >> >> > -- ==================================================== Nicholas J. Matzke Ph.D. student, Graduate Student Researcher Huelsenbeck Lab Center for Theoretical Evolutionary Genomics 4151 VLSB (Valley Life Sciences Building) Department of Integrative Biology University of California, Berkeley Lab websites: http://ib.berkeley.edu/people/lab_detail.php?lab=54 http://fisher.berkeley.edu/cteg/hlab.html Dept. personal page: http://ib.berkeley.edu/people/students/person_detail.php?person=370 Lab personal page: http://fisher.berkeley.edu/cteg/members/matzke.html Lab phone: 510-643-6299 Dept. fax: 510-643-6264 Cell phone: 510-301-0179 Email: ma...@be... Mailing address: Department of Integrative Biology 3060 VLSB #3140 Berkeley, CA 94720-3140 ----------------------------------------------------- "[W]hen people thought the earth was flat, they were wrong. When people thought the earth was spherical, they were wrong. But if you think that thinking the earth is spherical is just as wrong as thinking the earth is flat, then your view is wronger than both of them put together." Isaac Asimov (1989). "The Relativity of Wrong." The Skeptical Inquirer, 14(1), 35-44. Fall 1989. http://chem.tufts.edu/AnswersInScience/RelativityofWrong.htm ====================================================
On Mon, Jan 26, 2009 at 1:10 PM, Christopher Barker <Chr...@no...> wrote: > John Hunter wrote: >> OK, I can reproduce the problem and the solution is easy. Open the >> file in universal mode and pass the file handle to csv2rec:: > > Shouldn't csv2rec open files in Universal mode by default anyway? The only down side I can see to this is universal support can be disabled at build time, though it is on by default. At least this is my interpretation of http://www.python.org/dev/peps/pep-0278/ It's a pretty rare bug (in my experience and I work on linux, unix and os x and freqeuently with excel files) with an easy workaround (pass in your own file handle) so I am not sure we need a fix here. JDH
Hi Mauro & Lionel, I tried changing the backend to WX (and WxAgg) via the matplotlibrc file, but got the same result. Other suggestions welcome! Nick WX: ================== mws2:/bioinformatics/croizat/Croizat nick$ py Croizat.py matplotlib data path /Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/matplotlib-0.98.3.0001-py2.5-macosx-10.3-fat.egg/matplotlib/mpl-data loaded rc file /Users/nick/.matplotlib/matplotlibrc matplotlib version 0.98.3 verbose.level helpful interactive is True units is False platform is darwin numerix numpy 1.1.1 $HOME=/Users/nick CONFIGDIR=/Users/nick/.matplotlib Using fontManager instance from /Users/nick/.matplotlib/fontManager.cache backend WX version 2.8.7.1 Traceback (most recent call last): File "Croizat.py", line 71, in <module> Croizat = Application(0) File "/Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/wxPython-2.8.7.1.0003_s-py2.5-macosx-10.3-fat.egg/wx/_core.py", line 7836, in __init__ self._BootstrapApp() File "/Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/wxPython-2.8.7.1.0003_s-py2.5-macosx-10.3-fat.egg/wx/_core.py", line 7433, in _BootstrapApp return _core_.PyApp__BootstrapApp(*args, **kwargs) File "Croizat.py", line 62, in OnInit MainWindow = MainForm(None, -1, "") File "/home/maurobio/Projetos/Croizat/source/MainForm.py", line 201, in __init__ File "/home/maurobio/Projetos/Croizat/source/MainForm.py", line 320, in __do_layout File "/home/maurobio/Projetos/Croizat/source/MainForm.py", line 1187, in DrawMap File "/Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/basemap-0.99.1.0001-py2.5-macosx-10.3-fat.egg/mpl_toolkits/basemap/__init__.py", line 1361, in drawcoastlines self.set_axes_limits(ax=ax) File "/Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/basemap-0.99.1.0001-py2.5-macosx-10.3-fat.egg/mpl_toolkits/basemap/__init__.py", line 2501, in set_axes_limits figManager.canvas.draw() AttributeError: 'NoneType' object has no attribute 'canvas' ================== WxAgg: =================== mws2:/bioinformatics/croizat/Croizat nick$ py Croizat.py matplotlib data path /Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/matplotlib-0.98.3.0001-py2.5-macosx-10.3-fat.egg/matplotlib/mpl-data loaded rc file /Users/nick/.matplotlib/matplotlibrc matplotlib version 0.98.3 verbose.level helpful interactive is True units is False platform is darwin numerix numpy 1.1.1 $HOME=/Users/nick CONFIGDIR=/Users/nick/.matplotlib Using fontManager instance from /Users/nick/.matplotlib/fontManager.cache backend WXAgg version 2.8.7.1 Traceback (most recent call last): File "Croizat.py", line 71, in <module> Croizat = Application(0) File "/Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/wxPython-2.8.7.1.0003_s-py2.5-macosx-10.3-fat.egg/wx/_core.py", line 7836, in __init__ self._BootstrapApp() File "/Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/wxPython-2.8.7.1.0003_s-py2.5-macosx-10.3-fat.egg/wx/_core.py", line 7433, in _BootstrapApp return _core_.PyApp__BootstrapApp(*args, **kwargs) File "Croizat.py", line 62, in OnInit MainWindow = MainForm(None, -1, "") File "/home/maurobio/Projetos/Croizat/source/MainForm.py", line 201, in __init__ File "/home/maurobio/Projetos/Croizat/source/MainForm.py", line 320, in __do_layout File "/home/maurobio/Projetos/Croizat/source/MainForm.py", line 1187, in DrawMap File "/Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/basemap-0.99.1.0001-py2.5-macosx-10.3-fat.egg/mpl_toolkits/basemap/__init__.py", line 1361, in drawcoastlines self.set_axes_limits(ax=ax) File "/Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/basemap-0.99.1.0001-py2.5-macosx-10.3-fat.egg/mpl_toolkits/basemap/__init__.py", line 2501, in set_axes_limits figManager.canvas.draw() AttributeError: 'NoneType' object has no attribute 'canvas' mws2:/bioinformatics/croizat/Croizat nick$ =================== Mauro Cavalcanti wrote: > Dear Nick, > > I got this reply from one of the members of the Matplotlib-users > discussion list. I don't know if it will help, but maybe a start. > > Another suggestion I may give you just occurred me yesterday: try > deleting all the .pyc files included in the "Croizat" distribution > archive, then go to the /source sub-folder of the installation folder > and run the Croizat.py file from there. The Python interpreter will > recompile the code and rebuild the .pyc files in the source folder. > Maybe this will help. Anyway, let me know the results. > > With warmest regards, > > > ---------- Forwarded message ---------- > From: Lionel Roubeyrie <lro...@li...> > Date: 2009年1月22日 > Subject: Re: [Matplotlib-users] Fwd: Croizat on Mac OS X > To: Matplotlib Users <mat...@li...> > > > Maybe a backend problem, since your soft is based on wx and the user > uses Tk : > ... >> Using fontManager instance from /Users/nick/.matplotlib/fontManager.cache >> backend TkAgg version 8.4 >> Traceback (most recent call last): >> File "Croizat.py", line 71, in <module> >> Croizat = Application(0) > ... > -- > Lionel Roubeyrie > chargé d'études > LIMAIR - La Surveillance de l'Air en Limousin > http://www.limair.asso.fr > > > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by: > SourcForge Community > SourceForge wants to tell your story. > http://p.sf.net/sfu/sf-spreadtheword > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > > -- ==================================================== Nicholas J. Matzke Ph.D. student, Graduate Student Researcher Huelsenbeck Lab Center for Theoretical Evolutionary Genomics 4151 VLSB (Valley Life Sciences Building) Department of Integrative Biology University of California, Berkeley Lab websites: http://ib.berkeley.edu/people/lab_detail.php?lab=54 http://fisher.berkeley.edu/cteg/hlab.html Dept. personal page: http://ib.berkeley.edu/people/students/person_detail.php?person=370 Lab personal page: http://fisher.berkeley.edu/cteg/members/matzke.html Lab phone: 510-643-6299 Dept. fax: 510-643-6264 Cell phone: 510-301-0179 Email: ma...@be... Mailing address: Department of Integrative Biology 3060 VLSB #3140 Berkeley, CA 94720-3140 ----------------------------------------------------- "[W]hen people thought the earth was flat, they were wrong. When people thought the earth was spherical, they were wrong. But if you think that thinking the earth is spherical is just as wrong as thinking the earth is flat, then your view is wronger than both of them put together." Isaac Asimov (1989). "The Relativity of Wrong." The Skeptical Inquirer, 14(1), 35-44. Fall 1989. http://chem.tufts.edu/AnswersInScience/RelativityofWrong.htm ====================================================
Glenn wrote: > I tried to install matplotlib-0.98.5.2-py2.5-macosx10.5.mpkg, but got > the following error: > > You cannot install matplotlib 0.98.5.2-r0 on this volume. matplotlib > requires System Python 2.5 to install. That message is a misnomer -- the mpkg is built for the Framework install from python.org -- > Python 2.5.1 is installed. It's my workhorse. What do I need to change > so the package installer knows that it is present? you can't -- but I think the binary egg might work for you. > $ ls -l /usr/bin/python > lrwxr-xr-x 1 root wheel 72 Nov 18 2007 /usr/bin/python -> ../../ > System/Library/Frameworks/Python.framework/Versions/2.5/bin/python It's looking for: /Library/Frameworks/Python.framework/.. (not the one Apple installed in System) -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chr...@no...
John Hunter wrote: > OK, I can reproduce the problem and the solution is easy. Open the > file in universal mode and pass the file handle to csv2rec:: Shouldn't csv2rec open files in Universal mode by default anyway? -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chr...@no...
Abhinav Verma wrote: > Yes Eric this is what I wanted and Many thanks for your help. > > My question now extends a little. Due to this .. my yaxis label is > truncated in the png. How can I make sure that my figure is square and > also contains everything. Is it possilbe? There is no standard automatic method; you have to adjust the position of the axes within the figure. You can either specify the position explicitly by using ax = fig.add_axes([l,b,w,h] in place of add_subplot, and with l, b, w, h being left, bottom, width, and height in normalized coordinates (i.e., fractions of the figure window), or you can use fig.add_subplot together with fig.subplots_adjust(**kwargs). Either way, to figure out how to set the l,b,w,h, you can first make the plot interactively and use the "Configure subplots" tool (next to last on the right) in the toolbar to interactively adjust the axes position and to show you what the values are that make it look right. The default axes and subplot positioning parameters are also available via rcParams. Eric
On Mon, Jan 26, 2009 at 11:12 AM, Linda Chen <ch...@mi...> wrote: > > Dear John Hunter, > > Thanks for your response. Here is what I get: > > C:\Documents and Settings\Linda\Desktop\python>dir > Volume in drive C is WinXP > Volume Serial Number is 543D-51FE > > Directory of C:\Documents and Settings\Linda\Desktop\py > > 01/24/2009 04:34 PM <DIR> . > 01/24/2009 04:34 PM <DIR> .. > 01/21/2009 10:58 PM 89 data.dat > 01/20/2009 02:28 PM 1,001 fileout.py > 01/14/2009 04:15 PM 32 first.py > 01/24/2009 04:34 PM 130 rand.dat > 01/16/2009 03:21 PM 562 random.py > 01/21/2009 10:01 PM 818 random.pyc > 01/21/2009 02:44 PM 478 random1.py > 01/23/2009 04:43 PM 344 readdata.py > 01/21/2009 11:29 PM 315 readdata.py~ > 01/24/2009 04:34 PM 21 readdatatest.py > 01/24/2009 04:34 PM 344 readdatatest.py~ > 01/21/2009 10:58 PM 11 test.dat > 12 File(s) 4,145 bytes > 2 Dir(s) 17,915,678,720 bytes free > > C:\Documents and Settings\Linda\Desktop\python> OK, the problem is that you have a python file called random.py in the folder you are trying to run pylab from. random is a module that is part of the python standard library, and matplotlib depends upon it.. When one of the matplotlib dependencies tries to import random, it sees your random.py file rather than the one that ships with python, because the module search path checks the local dir first. You need to either remove or rename the file, or run pylab from another directory. In general, it is good practice to avoid naming files or modules after one of the python standard library modules. You can find a list here: http://docs.python.org/library/ JDH
Dear John Hunter, Thanks for your response. Here is what I get: C:\Documents and Settings\Linda\Desktop\python>dir Volume in drive C is WinXP Volume Serial Number is 543D-51FE Directory of C:\Documents and Settings\Linda\Desktop\py 01/24/2009 04:34 PM <DIR> . 01/24/2009 04:34 PM <DIR> .. 01/21/2009 10:58 PM 89 data.dat 01/20/2009 02:28 PM 1,001 fileout.py 01/14/2009 04:15 PM 32 first.py 01/24/2009 04:34 PM 130 rand.dat 01/16/2009 03:21 PM 562 random.py 01/21/2009 10:01 PM 818 random.pyc 01/21/2009 02:44 PM 478 random1.py 01/23/2009 04:43 PM 344 readdata.py 01/21/2009 11:29 PM 315 readdata.py~ 01/24/2009 04:34 PM 21 readdatatest.py 01/24/2009 04:34 PM 344 readdatatest.py~ 01/21/2009 10:58 PM 11 test.dat 12 File(s) 4,145 bytes 2 Dir(s) 17,915,678,720 bytes free C:\Documents and Settings\Linda\Desktop\python> Thanks, Linda. -----Original Message----- From: John Hunter [mailto:jd...@gm...] Sent: Sunday, January 25, 2009 9:38 PM To: ch...@mi... Cc: mat...@li... Subject: Re: [Matplotlib-users] import pylab problem On Sat, Jan 24, 2009 at 3:38 PM, Linda Chen <ch...@mi...> wrote: > Dear matplotlib-users, > > I'm having trouble importing pylab and I hope someone can help me. The error > message is: > > > > Microsoft Windows XP [Version 5.1.2600] > (C) Copyright 1985-2001 Microsoft Corp. > > C:\Documents and Settings\Linda>cd desktop\python > > C:\Documents and Settings\Linda\Desktop\python>python readdata.py > Traceback (most recent call last): > File "readdata.py", line 1, in <module> > import pylab > File "C:\Python25\Lib\site-packages\pylab.py", line 1, in <module> > from matplotlib.pylab import * > File "C:\Python25\Lib\site-packages\matplotlib\__init__.py", line 127, in > <mod > ule> > import sys, os, tempfile > File "C:\python25\lib\tempfile.py", line 33, in <module> > from random import Random as _Random > ImportError: cannot import name Random > Any chance there is a directory named "random" in the directory from which you are running python, eg what does "dir" show right before you run python? For example, see http://www.mail-archive.com/num...@sc.../msg14644.html JDH
Willi Richert <w.r...@gm...> writes: >> > Isn't there a convenient way just to not plot the big white rectangle in >> > matplotlib? >> >> It seems that >> >> fig=plt.figure(frameon=False) >> >> omits the rectangle. > > in my version 0.98.5 frameon=False (as a subplot argument) just omits the > black lines at the x and y axes. The huge white rectangle is still > plotted. I meant to use frameon=False as an argument to figure, not to subplot. Jouni
As Jouni suggested, the frameon argument needs to be applied to the figure, not to the axes (or subplot). Regards, -JJ On Mon, Jan 26, 2009 at 10:54 AM, Willi Richert <w.r...@gm...> wrote: > Hi, > > in my version 0.98.5 frameon=False (as a subplot argument) just omits the > black lines at the x and y axes. The huge white rectangle is still plotted. > > wr > > Am Montag, 26. Januar 2009 16:20:10 schrieb Jouni K. Seppänen: >> Willi Richert <w.r...@gm...> writes: >> > Isn't there a convenient way just to not plot the big white rectangle in >> > matplotlib? >> >> It seems that >> >> fig=plt.figure(frameon=False) >> >> omits the rectangle. > > > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by: > SourcForge Community > SourceForge wants to tell your story. > http://p.sf.net/sfu/sf-spreadtheword > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users >
Hello Patrick, > I had similar problems building on my windows machine until I did this > and now it works fine. You might also check all the README documents, > as one of them gives you more information about building for windows. I followed the instructions from README in win32_static precisely. This created file libpython26.a fine, etc. The build and installation process finished fine. However, when I try to do now >>> import matplotlib >>> from pylab import * I get: Traceback (most recent call last): File "<pyshell#1>", line 1, in <module> from pylab import * File "C:\Python26\Lib\site-packages\pylab.py", line 1, in <module> from matplotlib.pylab import * File "c:\Python26\Lib\site-packages\matplotlib\pylab.py", line 206, in <module> from matplotlib import mpl # pulls in most modules File "c:\Python26\Lib\site-packages\matplotlib\mpl.py", line 1, in <module> from matplotlib import artist File "c:\Python26\Lib\site-packages\matplotlib\artist.py", line 5, in <module> from transforms import Bbox, IdentityTransform, TransformedBbox, TransformedPath File "c:\Python26\Lib\site-packages\matplotlib\transforms.py", line 34, in <module> from matplotlib._path import affine_transform ImportError: DLL load failed: The specified procedure could not be found. Regards, mk
Hi, in my version 0.98.5 frameon=False (as a subplot argument) just omits the black lines at the x and y axes. The huge white rectangle is still plotted. wr Am Montag, 26. Januar 2009 16:20:10 schrieb Jouni K. Seppänen: > Willi Richert <w.r...@gm...> writes: > > Isn't there a convenient way just to not plot the big white rectangle in > > matplotlib? > > It seems that > > fig=plt.figure(frameon=False) > > omits the rectangle.
Greetings, Did you download the win32_static folder and place it in the top level of the matplotlic source? I had similar problems building on my windows machine until I did this and now it works fine. You might also check all the README documents, as one of them gives you more information about building for windows. -Patrick On Mon, Jan 26, 2009 at 8:17 AM, Marcin Krol <mr...@gm...> wrote: > Hello everyone, > > I'm trying to get 0.98.5.2 installed on Windows to use Python 2.6 > (dependency packages I need to use on that version, long story, etc). > > When I was trying to build it (python setup.py build), it was finding > the VC 9.0 C++ compiler on my comp. However, after adding necessary > packages (zlib, png, etc), it was reporting missing 'unistd.h'. Clearly, > this means it was meant to be built with GCC for Windows like MinGW ? > > I have uninstalled the VC compiler, installed GnuWin32 packages and > tried using MinGW (passing --compiler=mingw32 to python setup.py build ) > but now compilation process fails like this: > > c:\MinGW\bin\g++.exe -mno-cygwin -shared -s > build\temp.win32-2.6\Release\src\ft2font.o build\temp.wi > n32-2.6\Release\src\mplutils.o > build\temp.win32-2.6\Release\cxx\cxxsupport.o build\temp.win32-2.6\Re > lease\cxx\cxx_extensions.o > build\temp.win32-2.6\Release\cxx\indirectpythoninterface.o build\temp.win > 32-2.6\Release\cxx\cxxextensions.o > build\temp.win32-2.6\Release\src\ft2font.def -LC:\Python26\libs - > LC:\Python26\PCbuild -lfreetype -lz -lgw32c -lstdc++ -lm -lpython26 > -lmsvcr90 -o build\lib.win32-2.6 > \matplotlib\ft2font.pyd > c:\MinGW\bin\..\lib\gcc\mingw323円.4.5\..\..\..\..\mingw32\bin\ld.exe: > cannot find -lgw32c > collect2: ld returned 1 exit status > error: command 'g++' failed with exit status 1 > > What the heck is lgw32c?? > > Regards, > mk > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by: > SourcForge Community > SourceForge wants to tell your story. > http://p.sf.net/sfu/sf-spreadtheword > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > -- Patrick Marsh Graduate Research Assistant School of Meteorology University of Oklahoma http://www.patricktmarsh.com
Willi Richert <w.r...@gm...> writes: > Isn't there a convenient way just to not plot the big white rectangle in > matplotlib? It seems that fig=plt.figure(frameon=False) omits the rectangle. -- Jouni K. Seppänen http://www.iki.fi/jks
John Hunter wrote: > On Mon, Jan 26, 2009 at 8:40 AM, Michael Droettboom <md...@st...> wrote: > >> Support for handling NaNs in curves is now on the branch and trunk. >> >> While this solves the infinite recursion problem, it still may be better in >> your specific case to use a CirclePolygon. All my fix does is remove an >> entire bezier curve when any of its elements are non-finite -- so we're >> talking an entire eighth-wedge at least here. By using CirclePolygon, the >> amount of removal could be much less. >> > > While I think it's great that you fixed this with a scapel rather than > my blunt hammer of simply dropping the patch, I wonder if we should be > expecting the backends to handle nans. The general philosophy has > been to keep them as simple as possible, and nan handling is > definitely not simple. Most likely we would pay a price in efficiency > by moving the nan handling to the frontend, but would we be better off > passing a nan-filtered path to the backend? > I don't see this as a backend/frontend issue -- I see it as a C++/Python one. This recent change was in C++ (in PathIterator), which is generic and not specific to Agg, other than some conventions. For the Python backends, this is handled by Path.iter_vertices. This separation of NaN-handling (in C++ and in Path.iter_vertices) has been there for ages. In fact, the non-C++ backends have supported NaNs on curves for a long time (though with a small corner-case bug that's now fixed). The Cocoa backend should probably use the common NaN-handling and simplification code, but that may require using Objective-C++, rather than just Objective-C. Alternatively, we could rewrite the NaN-handling/simplification code to use pure C, with a little shim to make it work in the highly-templatized C++ Agg world. We could (as we do now for simplification) call out to C++ for NaN-handling as well, but I would be wary of doing the opposite. Mike -- Michael Droettboom Science Software Branch Operations and Engineering Division Space Telescope Science Institute Operated by AURA for NASA
I have the following code: ax1.pie(fracs, explode=explode, labels=labels, autopct='%1.1f%%', shadow=True, pctdistance=0.9, labeldistance=1.1,) ax1.legend(labels, loc=0, shadow=True, prop = smallfont) And the chart: http://www.nabble.com/file/p21667217/C3_Pie__count_daysInWeek_2009年01月26日_16.13.47.png C3_Pie__count_daysInWeek_2009年01月26日_16.13.47.png Why do I get wrong legend colors??? Thank you for your help, Ales -- View this message in context: http://www.nabble.com/Axes-Pie-chart-wrong-legend-colors-tp21667217p21667217.html Sent from the matplotlib - users mailing list archive at Nabble.com.
On Mon, Jan 26, 2009 at 6:17 AM, Gary Ruben <gr...@bi...> wrote: > Has the mec always been black? I thought it used to be the same as the > line colour. I expected it to default to the line colour, as Che expected. It's been this way since at least 2004: http://matplotlib.svn.sourceforge.net/viewvc/matplotlib/trunk/matplotlib/lib/matplotlib/__init__.py?revision=540&view=markup JDH
On Mon, Jan 26, 2009 at 8:40 AM, Michael Droettboom <md...@st...> wrote: > Support for handling NaNs in curves is now on the branch and trunk. > > While this solves the infinite recursion problem, it still may be better in > your specific case to use a CirclePolygon. All my fix does is remove an > entire bezier curve when any of its elements are non-finite -- so we're > talking an entire eighth-wedge at least here. By using CirclePolygon, the > amount of removal could be much less. While I think it's great that you fixed this with a scapel rather than my blunt hammer of simply dropping the patch, I wonder if we should be expecting the backends to handle nans. The general philosophy has been to keep them as simple as possible, and nan handling is definitely not simple. Most likely we would pay a price in efficiency by moving the nan handling to the frontend, but would we be better off passing a nan-filtered path to the backend? JDH
Support for handling NaNs in curves is now on the branch and trunk. While this solves the infinite recursion problem, it still may be better in your specific case to use a CirclePolygon. All my fix does is remove an entire bezier curve when any of its elements are non-finite -- so we're talking an entire eighth-wedge at least here. By using CirclePolygon, the amount of removal could be much less. Mike Michael Droettboom wrote: > At one point in history, the Agg backend would not do NaN removal on > paths with curves -- but it looks like that's been inadvertently lost, > probably in all the shuffling wrt simplification that went on, since > simplification has similar restrictions. So at present, we have > problems because it's passing curves with too few points to Agg, since > it removes points with NaNs, but not necessarily the entire curve > segment. In any case, even passing the vertices as-is (without NaNs > removed) to Agg still results in an infinite loop. > > The "real" fix, IMO, is to make the NaN-handling code aware of curves, > which requires doing a look-ahead. That is -- if a curve segment has > any NaNs at all, remove the entire curve segment. I've thought about > this for a bit, but now here's some impetus to finally implement it. :) > > Mike > > John Hunter wrote: > >> On Fri, Jan 23, 2009 at 2:06 PM, Michael Hearne <mh...@us...> wrote: >> >> >>> I have discovered, from the mailing list, the easy way to draw a circle >>> in linear space: >>> ...snip >>> cx = 700 >>> cy = 700 >>> r = 1000 >>> >>> xmin = cx - r >>> xmax = cx + r >>> ymin = cy - r >>> ymax = cy + r >>> >>> cir = Circle( (cx,cx), radius=r,facecolor='w',edgecolor='b') >>> a = gca() >>> a.add_patch(cir) >>> >>> axis([xmin,xmax,ymin,ymax]) >>> axis('equal') >>> >>> How can I plot a circle in log space? >>> >>> >> The problem is that your circle has negative vertices since cx-r<0 and >> cy-r<0. When this happens, mpl is transforming the vertices with log >> coordinates and getting nans, as it should. The problem is that these >> nan vertices are getting passed to the agg backend, and when the >> vertex type is curve4, as it is for a circle, agg gets stuck in an >> infinite recursion in the spline code. I suspect this is because the >> recursion expects the comparison operator on the vertices to be well >> behaved, but it is not in the presence of nans. The function in >> question is agg_curve.cpp curve4_div::recursive_bezier. There is a >> "maximum recursion limit" in that function, but for some reason I >> don't understand, it is not breaking out of the function. >> >> I committed a simple "fix" to the branch and the trunk to simply drop >> any patch where any of the vertices are nans >> >> if not np.isnan(tpath.vertices).any(): >> renderer.draw_path(gc, tpath, affine, rgbFace) >> >> We might be able to do better than this -- is there a well defined way >> to deal with patches where any of the transformed vertices are nans? >> For simple polygons (no splines vertices), we could plot the polygon >> with all the nan containing vertices removed, though in some cases >> this could be a strange object -- this appears to be what was >> happening by default with CirclePolygon with negative vertices but I >> think this was mostly fortuitous that agg dealt with the nans >> gracefully in this case. But for patches containing curve vertices, >> this seems like a bad idea, since simply dropping vertices from a >> spline curve is not defined. >> >> I'm including below some sample code that shows the bug on Agg >> >> JDH >> >> import matplotlib >> matplotlib.use('Agg') >> >> import matplotlib.pyplot as plt >> import matplotlib.patches as patches >> cx = 700 >> cy = 700 >> r = 1000 >> >> fig = plt.figure() >> ax = fig.add_subplot(111) >> >> #cir = patches.CirclePolygon( (cx,cy), radius=r,facecolor='w',edgecolor='b') >> cir = patches.Circle( (cx,cy), radius=r,facecolor='w',edgecolor='b') >> ax.add_patch(cir) >> ax.set_yscale('log') >> fig.savefig('test') >> plt.show() >> >> > > -- Michael Droettboom Science Software Branch Operations and Engineering Division Space Telescope Science Institute Operated by AURA for NASA
Hello everyone, I'm trying to get 0.98.5.2 installed on Windows to use Python 2.6 (dependency packages I need to use on that version, long story, etc). When I was trying to build it (python setup.py build), it was finding the VC 9.0 C++ compiler on my comp. However, after adding necessary packages (zlib, png, etc), it was reporting missing 'unistd.h'. Clearly, this means it was meant to be built with GCC for Windows like MinGW ? I have uninstalled the VC compiler, installed GnuWin32 packages and tried using MinGW (passing --compiler=mingw32 to python setup.py build ) but now compilation process fails like this: c:\MinGW\bin\g++.exe -mno-cygwin -shared -s build\temp.win32-2.6\Release\src\ft2font.o build\temp.wi n32-2.6\Release\src\mplutils.o build\temp.win32-2.6\Release\cxx\cxxsupport.o build\temp.win32-2.6\Re lease\cxx\cxx_extensions.o build\temp.win32-2.6\Release\cxx\indirectpythoninterface.o build\temp.win 32-2.6\Release\cxx\cxxextensions.o build\temp.win32-2.6\Release\src\ft2font.def -LC:\Python26\libs - LC:\Python26\PCbuild -lfreetype -lz -lgw32c -lstdc++ -lm -lpython26 -lmsvcr90 -o build\lib.win32-2.6 \matplotlib\ft2font.pyd c:\MinGW\bin\..\lib\gcc\mingw323円.4.5\..\..\..\..\mingw32\bin\ld.exe: cannot find -lgw32c collect2: ld returned 1 exit status error: command 'g++' failed with exit status 1 What the heck is lgw32c?? Regards, mk
Has the mec always been black? I thought it used to be the same as the line colour. I expected it to default to the line colour, as Che expected. Gary R. Norbert Nemec wrote: > Sorry for my misleading words - I did not correctly recall my own work > from back then... > > In fact, the code as it is does not change the mec automatically when > the mfc of a filled_marker is set to "None" but leaves it black. I did > consider adding an automation to change but decided against it. The > logic would have become too complex and hard to predict. > > What you can do is setting the mec afterwards using get_color on the > plot like > > pl, = plot(x,y,"-o",mfc="None") > pl.set_mec(pl.get_color()) > > Hope that helps? > > Greetings, > Norbert
At one point in history, the Agg backend would not do NaN removal on paths with curves -- but it looks like that's been inadvertently lost, probably in all the shuffling wrt simplification that went on, since simplification has similar restrictions. So at present, we have problems because it's passing curves with too few points to Agg, since it removes points with NaNs, but not necessarily the entire curve segment. In any case, even passing the vertices as-is (without NaNs removed) to Agg still results in an infinite loop. The "real" fix, IMO, is to make the NaN-handling code aware of curves, which requires doing a look-ahead. That is -- if a curve segment has any NaNs at all, remove the entire curve segment. I've thought about this for a bit, but now here's some impetus to finally implement it. :) Mike John Hunter wrote: > On Fri, Jan 23, 2009 at 2:06 PM, Michael Hearne <mh...@us...> wrote: > >> I have discovered, from the mailing list, the easy way to draw a circle >> in linear space: >> ...snip >> cx = 700 >> cy = 700 >> r = 1000 >> >> xmin = cx - r >> xmax = cx + r >> ymin = cy - r >> ymax = cy + r >> >> cir = Circle( (cx,cx), radius=r,facecolor='w',edgecolor='b') >> a = gca() >> a.add_patch(cir) >> >> axis([xmin,xmax,ymin,ymax]) >> axis('equal') >> >> How can I plot a circle in log space? >> > > The problem is that your circle has negative vertices since cx-r<0 and > cy-r<0. When this happens, mpl is transforming the vertices with log > coordinates and getting nans, as it should. The problem is that these > nan vertices are getting passed to the agg backend, and when the > vertex type is curve4, as it is for a circle, agg gets stuck in an > infinite recursion in the spline code. I suspect this is because the > recursion expects the comparison operator on the vertices to be well > behaved, but it is not in the presence of nans. The function in > question is agg_curve.cpp curve4_div::recursive_bezier. There is a > "maximum recursion limit" in that function, but for some reason I > don't understand, it is not breaking out of the function. > > I committed a simple "fix" to the branch and the trunk to simply drop > any patch where any of the vertices are nans > > if not np.isnan(tpath.vertices).any(): > renderer.draw_path(gc, tpath, affine, rgbFace) > > We might be able to do better than this -- is there a well defined way > to deal with patches where any of the transformed vertices are nans? > For simple polygons (no splines vertices), we could plot the polygon > with all the nan containing vertices removed, though in some cases > this could be a strange object -- this appears to be what was > happening by default with CirclePolygon with negative vertices but I > think this was mostly fortuitous that agg dealt with the nans > gracefully in this case. But for patches containing curve vertices, > this seems like a bad idea, since simply dropping vertices from a > spline curve is not defined. > > I'm including below some sample code that shows the bug on Agg > > JDH > > import matplotlib > matplotlib.use('Agg') > > import matplotlib.pyplot as plt > import matplotlib.patches as patches > cx = 700 > cy = 700 > r = 1000 > > fig = plt.figure() > ax = fig.add_subplot(111) > > #cir = patches.CirclePolygon( (cx,cy), radius=r,facecolor='w',edgecolor='b') > cir = patches.Circle( (cx,cy), radius=r,facecolor='w',edgecolor='b') > ax.add_patch(cir) > ax.set_yscale('log') > fig.savefig('test') > plt.show() > -- Michael Droettboom Science Software Branch Operations and Engineering Division Space Telescope Science Institute Operated by AURA for NASA