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
(5) |
|
2
|
3
(3) |
4
(16) |
5
(8) |
6
(22) |
7
(10) |
8
(18) |
|
9
(11) |
10
(7) |
11
(16) |
12
(1) |
13
(10) |
14
(14) |
15
(2) |
|
16
(3) |
17
(19) |
18
(24) |
19
(35) |
20
(38) |
21
(27) |
22
(1) |
|
23
(9) |
24
(6) |
25
(24) |
26
(9) |
27
(7) |
28
(5) |
29
(9) |
|
30
(4) |
|
|
|
|
|
|
|
From: Mauro C. <mau...@gm...> - 2008-11-25 23:30:12
|
Dear Tim, Thanks for your message. I am not just "trying", I am indeed implementing a software package for species distribution mapping and biogeographic analysis, using wxPython/Matplotlib. And, by the way, it is going quite well. Both Thuban and QGis, as generalized implementations of GIS, are far from adequate for my needs (and of fellow conservation biologists). Hope this helps. Best regards, 2008/11/25 Tim Michelsen <tim...@gm...>: > Hello! > >> I am attaching the current version of source code plus a screenshot. > > I would like to ask you why you are trying to implement this by yourself > in wxPython/matplotlib. > > There are already two pythonised applications that may be used for your > purpose. And they are aware of the projections and different > geographical formats: > * QGIS with Pythons libary and plugins: > http://qgis.org/content/view/145/113/ > > * Thuban: http://thuban.intevation.org/ > > Maybe this could save you some work/time. > > Kind regards, > Timmie > > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's challenge > Build the coolest Linux based applications with Moblin SDK & win great prizes > Grand prize is a trip for two to an Open Source event anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > -- Dr. Mauro J. Cavalcanti Ecoinformatics Studio P.O. Box 46521, CEP 20551-970 Rio de Janeiro, RJ, BRASIL E-mail: mau...@gm... Web: http://studio.infobio.net Linux Registered User #473524 * Ubuntu User #22717 "Life is complex. It consists of real and imaginary parts." |
|
From: John H. <jd...@gm...> - 2008-11-25 22:11:20
|
On Tue, Nov 25, 2008 at 3:16 PM, John Hunter <jd...@gm...> wrote: > If the unicode minus is sufficiently problematic for you, I can add an > rc param. Something like > > axis.unicode_minus : True Added as rc param 'axes.unicode_minus' in svn r6453 with example examples/api/unicode_minus.py But I definitely second Michael's suggestion -- you don't want to be parsing ticklabels if you don't have too! JDH |
|
From: Michael D. <md...@st...> - 2008-11-25 21:23:51
|
No worries. I'm sort of a Unicode/i18n/typesetting geek, I guess... ;)
Mike
Drain, Theodore R wrote:
> OK - Thanks for the explanation. Sorry you had to type such a long response to my short little complaint :)
>
>
>> -----Original Message-----
>> From: Michael Droettboom [mailto:md...@st...]
>> Sent: Tuesday, November 25, 2008 1:06 PM
>> To: Drain, Theodore R
>> Cc: mat...@li...
>> Subject: Re: [Matplotlib-users] polar
>>
>> Drain, Theodore R wrote:
>>
>>> Michael,
>>> I think the issue is that there is no Unicode in the script that was
>>>
>> attached - it's just a simple polar call so the user isn't really
>> Unicode".
>>
>> Polar plots always use Unicode by default for the degree sign. It
>> would
>> be crazy to try to do those things without Unicode. The problem at
>> hand
>> here is only when usetex is on and text.latex.unicode is False. I
>> think
>> it's perhaps time to adjust the default on the latter to True to avoid
>> this issue -- but someone more familiar with usetex should comment on
>> that.
>>
>>> I think Unicode is starting to creep into the source in various
>>>
>> places
>> Use of Unicode characters in output has existed for some time. There
>> is, however, no Unicode in the source files (something we've had
>> transiently but have addressed), because it does cause a problem with
>> some editors. I think that's a reasonable style guideline, but
>> avoiding
>> Unicode in the output is not. I personally put in a lot of work to
>> support Unicode in all the backends -- it allows the output to be
>> richer
>> and more like traditional typesetting rather than being stuck with the
>> limitations imposed by 7-bit ASCII, which is the only reasonable
>> alternative.
>>
>>> - we just had a user point out that negative numbers are using a
>>>
>> normal negative sign ('-1.2') anymore but some kind of Unicode dash
>> that's a lot bigger than the normal one. I wonder if this could be
>> related...
>>
>> Yes, it's another instance of the same thing. (Though if usetex is
>> True, we don't have this specific problem, since TeX has always done
>> this substitution for us and matplotlib doesn't do the hyphen/minus
>> correction.)
>>
>>> (If it matters, most of our users would rather have just the regular
>>>
>> negative sign and not embedded Unicode in the axis labels - it looks
>> wrong to them and makes doing any kind of processing of axis labels
>> more difficult).
>>
>> I think that's a matter user preference, and perhaps should be exposed
>> as an rcParam. Personally, it's always bothers me to see TeX-typeset
>> papers where the math expressions have proper minus signs, but the
>> plots
>> use a hyphen. But maybe I'm too bothered by these things... ;)
>>
>> As for processing the axis labels, there are far hairier things (such
>> as
>> scientific notation) that make processing axis labels as strings in the
>> general case difficult. If you need their positions as numeric values,
>> one can simply use get_majorticklocs() and get an array of floats.
>>
>> Cheers,
>> Mike
>>
>>> Ted
>>>
>>>
>>>
>>>> -----Original Message-----
>>>> From: Michael Droettboom [mailto:md...@st...]
>>>> Sent: Tuesday, November 25, 2008 12:25 PM
>>>> To: Nils Wagner
>>>> Cc: mat...@li...
>>>> Subject: Re: [Matplotlib-users] polar
>>>>
>>>> It says:
>>>>
>>>> "You are using unicode and latex, but have not enabled the
>>>>
>> matplotlib
>>
>>>> 'text.latex.unicode' rcParam."
>>>>
>>>> Does setting text.latex.unicode to True resolve the issue?
>>>>
>>>> Maybe that message should be made more prominent -- it currently is
>>>> only
>>>> displayed when verbose is turned on, but it really is an exception.
>>>> Maybe that message should be raised, rather than reraising the
>>>>
>> original
>>
>>>> one there.
>>>>
>>>> Mike
>>>>
>>>> Nils Wagner wrote:
>>>>
>>>>
>>>>> Hi all,
>>>>>
>>>>> If I run the attached example I get
>>>>>
>>>>> python -i test_polar.py --verbose-helpful
>>>>> $HOME=/home/nwagner
>>>>> matplotlib data path /usr/lib/python2.4/site-
>>>>>
>> packages/matplotlib/mpl-
>>
>>>> data
>>>>
>>>>
>>>>> loaded rc file /home/nwagner/matplotlibrc
>>>>> matplotlib version 0.98.3
>>>>> verbose.level helpful
>>>>> interactive is False
>>>>> units is False
>>>>> platform is linux2
>>>>> CONFIGDIR=/home/nwagner/.matplotlib
>>>>> Using fontManager instance from
>>>>>
>>>>>
>>>> /home/nwagner/.matplotlib/fontList.cache
>>>>
>>>>
>>>>> backend WXAgg version 2.5.3.1
>>>>> findfont: Matching
>>>>> :family=sans-
>>>>>
>>>>>
>> serif:style=normal:variant=normal:weight=normal:stretch=normal:size=med
>>
>>>> ium
>>>>
>>>>
>>>>> to Bitstream Vera Sans
>>>>> (/usr/lib/python2.4/site-packages/matplotlib/mpl-
>>>>>
>>>>>
>>>> data/fonts/ttf/Vera.ttf)
>>>>
>>>>
>>>>> with score of 1.000000
>>>>> Found dvipng version 1.5
>>>>> You are using unicode and latex, but have not enabled the
>>>>>
>> matplotlib
>>
>>>>> 'text.latex.unicode' rcParam.
>>>>> Traceback (most recent call last):
>>>>> File
>>>>> "/usr/lib/python2.4/site-
>>>>>
>> packages/matplotlib/backends/backend_wx.py",
>>
>>>>> line 1121, in _onPaint
>>>>> self.draw(drawDC=drawDC)
>>>>> File
>>>>> "/usr/lib/python2.4/site-
>>>>>
>>>>>
>>>> packages/matplotlib/backends/backend_wxagg.py",
>>>>
>>>>
>>>>> line 60, in draw
>>>>> FigureCanvasAgg.draw(self)
>>>>> File
>>>>> "/usr/lib/python2.4/site-
>>>>>
>>>>>
>>>> packages/matplotlib/backends/backend_agg.py",
>>>>
>>>>
>>>>> line 283, in draw
>>>>> self.figure.draw(self.renderer)
>>>>> File "/usr/lib/python2.4/site-packages/matplotlib/figure.py",
>>>>>
>> line
>>
>>>>> 767, in draw
>>>>> for a in self.axes: a.draw(renderer)
>>>>> File "/usr/lib/python2.4/site-packages/matplotlib/axes.py", line
>>>>> 1591, in draw
>>>>> a.draw(renderer)
>>>>> File "/usr/lib/python2.4/site-packages/matplotlib/axis.py", line
>>>>> 710, in draw
>>>>> tick.draw(renderer)
>>>>> File "/usr/lib/python2.4/site-packages/matplotlib/axis.py", line
>>>>> 193, in draw
>>>>> self.label1.draw(renderer)
>>>>> File "/usr/lib/python2.4/site-packages/matplotlib/text.py", line
>>>>> 448, in draw
>>>>> bbox, info = self._get_layout(renderer)
>>>>> File "/usr/lib/python2.4/site-packages/matplotlib/text.py", line
>>>>> 251, in _get_layout
>>>>> w, h, d = renderer.get_text_width_height_descent(
>>>>> File
>>>>> "/usr/lib/python2.4/site-
>>>>>
>>>>>
>>>> packages/matplotlib/backends/backend_agg.py",
>>>>
>>>>
>>>>> line 150, in get_text_width_height_descent
>>>>> Z = texmanager.get_grey(s, size, self.dpi)
>>>>> File "/usr/lib/python2.4/site-packages/matplotlib/texmanager.py",
>>>>> line 383, in get_grey
>>>>> pngfile = self.make_png(tex, fontsize, dpi)
>>>>> File "/usr/lib/python2.4/site-packages/matplotlib/texmanager.py",
>>>>> line 312, in make_png
>>>>> dvifile = self.make_dvi(tex, fontsize)
>>>>> File "/usr/lib/python2.4/site-packages/matplotlib/texmanager.py",
>>>>> line 275, in make_dvi
>>>>> texfile = self.make_tex(tex, fontsize)
>>>>> File "/usr/lib/python2.4/site-packages/matplotlib/texmanager.py",
>>>>> line 254, in make_tex
>>>>> fh.write(s)
>>>>> UnicodeEncodeError: 'ascii' codec can't encode character u'\xb0' in
>>>>> position 300: ordinal not in range(128)
>>>>> You are using unicode and latex, but have not enabled the
>>>>>
>> matplotlib
>>
>>>>> 'text.latex.unicode' rcParam.
>>>>> Traceback (most recent call last):
>>>>> File
>>>>> "/usr/lib/python2.4/site-
>>>>>
>> packages/matplotlib/backends/backend_wx.py",
>>
>>>>> line 1121, in _onPaint
>>>>> self.draw(drawDC=drawDC)
>>>>> File
>>>>> "/usr/lib/python2.4/site-
>>>>>
>>>>>
>>>> packages/matplotlib/backends/backend_wxagg.py",
>>>>
>>>>
>>>>> line 60, in draw
>>>>> FigureCanvasAgg.draw(self)
>>>>> File
>>>>> "/usr/lib/python2.4/site-
>>>>>
>>>>>
>>>> packages/matplotlib/backends/backend_agg.py",
>>>>
>>>>
>>>>> line 283, in draw
>>>>> self.figure.draw(self.renderer)
>>>>> File "/usr/lib/python2.4/site-packages/matplotlib/figure.py",
>>>>>
>> line
>>
>>>>> 767, in draw
>>>>> for a in self.axes: a.draw(renderer)
>>>>> File "/usr/lib/python2.4/site-packages/matplotlib/axes.py", line
>>>>> 1591, in draw
>>>>> a.draw(renderer)
>>>>> File "/usr/lib/python2.4/site-packages/matplotlib/axis.py", line
>>>>> 710, in draw
>>>>> tick.draw(renderer)
>>>>> File "/usr/lib/python2.4/site-packages/matplotlib/axis.py", line
>>>>> 193, in draw
>>>>> self.label1.draw(renderer)
>>>>> File "/usr/lib/python2.4/site-packages/matplotlib/text.py", line
>>>>> 448, in draw
>>>>> bbox, info = self._get_layout(renderer)
>>>>> File "/usr/lib/python2.4/site-packages/matplotlib/text.py", line
>>>>> 251, in _get_layout
>>>>> w, h, d = renderer.get_text_width_height_descent(
>>>>> File
>>>>> "/usr/lib/python2.4/site-
>>>>>
>>>>>
>>>> packages/matplotlib/backends/backend_agg.py",
>>>>
>>>>
>>>>> line 150, in get_text_width_height_descent
>>>>> Z = texmanager.get_grey(s, size, self.dpi)
>>>>> File "/usr/lib/python2.4/site-packages/matplotlib/texmanager.py",
>>>>> line 383, in get_grey
>>>>> pngfile = self.make_png(tex, fontsize, dpi)
>>>>> File "/usr/lib/python2.4/site-packages/matplotlib/texmanager.py",
>>>>> line 312, in make_png
>>>>> dvifile = self.make_dvi(tex, fontsize)
>>>>> File "/usr/lib/python2.4/site-packages/matplotlib/texmanager.py",
>>>>> line 275, in make_dvi
>>>>> texfile = self.make_tex(tex, fontsize)
>>>>> File "/usr/lib/python2.4/site-packages/matplotlib/texmanager.py",
>>>>> line 254, in make_tex
>>>>> fh.write(s)
>>>>> UnicodeEncodeError: 'ascii' codec can't encode character u'\xb0' in
>>>>> position 300: ordinal not in range(128)
>>>>>
>>>>> Any idea ?
>>>>>
>>>>> Nils
>>>>>
>>>>> -------------------------------------------------------------------
>>>>>
>> --
>>
>>>> ---
>>>>
>>>>
>>>>> -------------------------------------------------------------------
>>>>>
>> --
>>
>>>> ----
>>>>
>>>>
>>>>> This SF.Net email is sponsored by the Moblin Your Move Developer's
>>>>>
>>>>>
>>>> challenge
>>>>
>>>>
>>>>> Build the coolest Linux based applications with Moblin SDK & win
>>>>>
>>>>>
>>>> great prizes
>>>>
>>>>
>>>>> Grand prize is a trip for two to an Open Source event anywhere in
>>>>>
>> the
>>
>>>> world
>>>>
>>>>
>>>>> http://moblin-contest.org/redirect.php?banner_id=100&url=/
>>>>> -------------------------------------------------------------------
>>>>>
>> --
>>
>>>> ---
>>>>
>>>>
>>>>> _______________________________________________
>>>>> Matplotlib-users mailing list
>>>>> Mat...@li...
>>>>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>>>>
>>>>>
>>>> --
>>>> Michael Droettboom
>>>> Science Software Branch
>>>> Operations and Engineering Division
>>>> Space Telescope Science Institute
>>>> Operated by AURA for NASA
>>>>
>>>>
>>>> --------------------------------------------------------------------
>>>>
>> ---
>>
>>>> --
>>>> This SF.Net email is sponsored by the Moblin Your Move Developer's
>>>> challenge
>>>> Build the coolest Linux based applications with Moblin SDK & win
>>>>
>> great
>>
>>>> prizes
>>>> Grand prize is a trip for two to an Open Source event anywhere in
>>>>
>> the
>>
>>>> world
>>>> http://moblin-contest.org/redirect.php?banner_id=100&url=/
>>>> _______________________________________________
>>>> Matplotlib-users mailing list
>>>> Mat...@li...
>>>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>>>
>>>> No virus found in this incoming message.
>>>> Checked by AVG - http://www.avg.com
>>>> Version: 8.0.175 / Virus Database: 270.9.10/1811 - Release Date:
>>>> 11/25/2008 8:29 AM
>>>>
>>>>
>>> ---------------------------------------------------------------------
>>>
>> ----
>>
>>> This SF.Net email is sponsored by the Moblin Your Move Developer's
>>>
>> challenge
>>
>>> Build the coolest Linux based applications with Moblin SDK & win
>>>
>> great prizes
>>
>>> Grand prize is a trip for two to an Open Source event anywhere in the
>>>
>> world
>>
>>> http://moblin-contest.org/redirect.php?banner_id=100&url=/
>>> _______________________________________________
>>> Matplotlib-users mailing list
>>> Mat...@li...
>>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>>
>>>
>> --
>> Michael Droettboom
>> Science Software Branch
>> Operations and Engineering Division
>> Space Telescope Science Institute
>> Operated by AURA for NASA
>>
>>
>> No virus found in this incoming message.
>> Checked by AVG - http://www.avg.com
>> Version: 8.0.175 / Virus Database: 270.9.10/1811 - Release Date:
>> 11/25/2008 8:29 AM
>>
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
> Build the coolest Linux based applications with Moblin SDK & win great prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
--
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA
|
|
From: Michael D. <md...@st...> - 2008-11-25 21:23:42
|
John Hunter wrote: > The problem here appears to be in > matplotlib.projects.polar.ThetaFormatter.__call__, which uses the > degree symbol. I think all we need to do is return the proper tex > string in this case. Michael, does this look right to you: > > def __call__(self, x, pos=None): > # \u00b0 : degree symbol > if rcParams['text.usetex'] and not rcParams['text.latex.unicode']: > return r"$%d^\circ$" % ((x / npy.pi) * 180.0) > else: > return u"%d\u00b0" % ((x / npy.pi) * 180.0) > Yeah. Looks good. Though a "usetex" guy should probably comment as to whether "text.latex.unicode == False" is still a good default. BTW -- the reason I didn't want to use the math syntax in the common case is so that it will work correctly with any arbitrary font (assuming it has a degree sign), whereas $5\circ$ will only work correctly with one of the supported math fonts (Computer Modern and STIX). For usetex, of course, it works fine. Cheers, Mike -- Michael Droettboom Science Software Branch Operations and Engineering Division Space Telescope Science Institute Operated by AURA for NASA |
|
From: Drain, T. R <the...@jp...> - 2008-11-25 21:20:14
|
OK - Thanks for the explanation. Sorry you had to type such a long response to my short little complaint :)
> -----Original Message-----
> From: Michael Droettboom [mailto:md...@st...]
> Sent: Tuesday, November 25, 2008 1:06 PM
> To: Drain, Theodore R
> Cc: mat...@li...
> Subject: Re: [Matplotlib-users] polar
>
> Drain, Theodore R wrote:
> > Michael,
> > I think the issue is that there is no Unicode in the script that was
> attached - it's just a simple polar call so the user isn't really
> Unicode".
> >
> Polar plots always use Unicode by default for the degree sign. It
> would
> be crazy to try to do those things without Unicode. The problem at
> hand
> here is only when usetex is on and text.latex.unicode is False. I
> think
> it's perhaps time to adjust the default on the latter to True to avoid
> this issue -- but someone more familiar with usetex should comment on
> that.
> > I think Unicode is starting to creep into the source in various
> places
> Use of Unicode characters in output has existed for some time. There
> is, however, no Unicode in the source files (something we've had
> transiently but have addressed), because it does cause a problem with
> some editors. I think that's a reasonable style guideline, but
> avoiding
> Unicode in the output is not. I personally put in a lot of work to
> support Unicode in all the backends -- it allows the output to be
> richer
> and more like traditional typesetting rather than being stuck with the
> limitations imposed by 7-bit ASCII, which is the only reasonable
> alternative.
> > - we just had a user point out that negative numbers are using a
> normal negative sign ('-1.2') anymore but some kind of Unicode dash
> that's a lot bigger than the normal one. I wonder if this could be
> related...
> >
> Yes, it's another instance of the same thing. (Though if usetex is
> True, we don't have this specific problem, since TeX has always done
> this substitution for us and matplotlib doesn't do the hyphen/minus
> correction.)
> > (If it matters, most of our users would rather have just the regular
> negative sign and not embedded Unicode in the axis labels - it looks
> wrong to them and makes doing any kind of processing of axis labels
> more difficult).
> >
> I think that's a matter user preference, and perhaps should be exposed
> as an rcParam. Personally, it's always bothers me to see TeX-typeset
> papers where the math expressions have proper minus signs, but the
> plots
> use a hyphen. But maybe I'm too bothered by these things... ;)
>
> As for processing the axis labels, there are far hairier things (such
> as
> scientific notation) that make processing axis labels as strings in the
> general case difficult. If you need their positions as numeric values,
> one can simply use get_majorticklocs() and get an array of floats.
>
> Cheers,
> Mike
> > Ted
> >
> >
> >> -----Original Message-----
> >> From: Michael Droettboom [mailto:md...@st...]
> >> Sent: Tuesday, November 25, 2008 12:25 PM
> >> To: Nils Wagner
> >> Cc: mat...@li...
> >> Subject: Re: [Matplotlib-users] polar
> >>
> >> It says:
> >>
> >> "You are using unicode and latex, but have not enabled the
> matplotlib
> >> 'text.latex.unicode' rcParam."
> >>
> >> Does setting text.latex.unicode to True resolve the issue?
> >>
> >> Maybe that message should be made more prominent -- it currently is
> >> only
> >> displayed when verbose is turned on, but it really is an exception.
> >> Maybe that message should be raised, rather than reraising the
> original
> >> one there.
> >>
> >> Mike
> >>
> >> Nils Wagner wrote:
> >>
> >>> Hi all,
> >>>
> >>> If I run the attached example I get
> >>>
> >>> python -i test_polar.py --verbose-helpful
> >>> $HOME=/home/nwagner
> >>> matplotlib data path /usr/lib/python2.4/site-
> packages/matplotlib/mpl-
> >>>
> >> data
> >>
> >>> loaded rc file /home/nwagner/matplotlibrc
> >>> matplotlib version 0.98.3
> >>> verbose.level helpful
> >>> interactive is False
> >>> units is False
> >>> platform is linux2
> >>> CONFIGDIR=/home/nwagner/.matplotlib
> >>> Using fontManager instance from
> >>>
> >> /home/nwagner/.matplotlib/fontList.cache
> >>
> >>> backend WXAgg version 2.5.3.1
> >>> findfont: Matching
> >>> :family=sans-
> >>>
> >>
> serif:style=normal:variant=normal:weight=normal:stretch=normal:size=med
> >> ium
> >>
> >>> to Bitstream Vera Sans
> >>> (/usr/lib/python2.4/site-packages/matplotlib/mpl-
> >>>
> >> data/fonts/ttf/Vera.ttf)
> >>
> >>> with score of 1.000000
> >>> Found dvipng version 1.5
> >>> You are using unicode and latex, but have not enabled the
> matplotlib
> >>> 'text.latex.unicode' rcParam.
> >>> Traceback (most recent call last):
> >>> File
> >>> "/usr/lib/python2.4/site-
> packages/matplotlib/backends/backend_wx.py",
> >>> line 1121, in _onPaint
> >>> self.draw(drawDC=drawDC)
> >>> File
> >>> "/usr/lib/python2.4/site-
> >>>
> >> packages/matplotlib/backends/backend_wxagg.py",
> >>
> >>> line 60, in draw
> >>> FigureCanvasAgg.draw(self)
> >>> File
> >>> "/usr/lib/python2.4/site-
> >>>
> >> packages/matplotlib/backends/backend_agg.py",
> >>
> >>> line 283, in draw
> >>> self.figure.draw(self.renderer)
> >>> File "/usr/lib/python2.4/site-packages/matplotlib/figure.py",
> line
> >>> 767, in draw
> >>> for a in self.axes: a.draw(renderer)
> >>> File "/usr/lib/python2.4/site-packages/matplotlib/axes.py", line
> >>> 1591, in draw
> >>> a.draw(renderer)
> >>> File "/usr/lib/python2.4/site-packages/matplotlib/axis.py", line
> >>> 710, in draw
> >>> tick.draw(renderer)
> >>> File "/usr/lib/python2.4/site-packages/matplotlib/axis.py", line
> >>> 193, in draw
> >>> self.label1.draw(renderer)
> >>> File "/usr/lib/python2.4/site-packages/matplotlib/text.py", line
> >>> 448, in draw
> >>> bbox, info = self._get_layout(renderer)
> >>> File "/usr/lib/python2.4/site-packages/matplotlib/text.py", line
> >>> 251, in _get_layout
> >>> w, h, d = renderer.get_text_width_height_descent(
> >>> File
> >>> "/usr/lib/python2.4/site-
> >>>
> >> packages/matplotlib/backends/backend_agg.py",
> >>
> >>> line 150, in get_text_width_height_descent
> >>> Z = texmanager.get_grey(s, size, self.dpi)
> >>> File "/usr/lib/python2.4/site-packages/matplotlib/texmanager.py",
> >>> line 383, in get_grey
> >>> pngfile = self.make_png(tex, fontsize, dpi)
> >>> File "/usr/lib/python2.4/site-packages/matplotlib/texmanager.py",
> >>> line 312, in make_png
> >>> dvifile = self.make_dvi(tex, fontsize)
> >>> File "/usr/lib/python2.4/site-packages/matplotlib/texmanager.py",
> >>> line 275, in make_dvi
> >>> texfile = self.make_tex(tex, fontsize)
> >>> File "/usr/lib/python2.4/site-packages/matplotlib/texmanager.py",
> >>> line 254, in make_tex
> >>> fh.write(s)
> >>> UnicodeEncodeError: 'ascii' codec can't encode character u'\xb0' in
> >>> position 300: ordinal not in range(128)
> >>> You are using unicode and latex, but have not enabled the
> matplotlib
> >>> 'text.latex.unicode' rcParam.
> >>> Traceback (most recent call last):
> >>> File
> >>> "/usr/lib/python2.4/site-
> packages/matplotlib/backends/backend_wx.py",
> >>> line 1121, in _onPaint
> >>> self.draw(drawDC=drawDC)
> >>> File
> >>> "/usr/lib/python2.4/site-
> >>>
> >> packages/matplotlib/backends/backend_wxagg.py",
> >>
> >>> line 60, in draw
> >>> FigureCanvasAgg.draw(self)
> >>> File
> >>> "/usr/lib/python2.4/site-
> >>>
> >> packages/matplotlib/backends/backend_agg.py",
> >>
> >>> line 283, in draw
> >>> self.figure.draw(self.renderer)
> >>> File "/usr/lib/python2.4/site-packages/matplotlib/figure.py",
> line
> >>> 767, in draw
> >>> for a in self.axes: a.draw(renderer)
> >>> File "/usr/lib/python2.4/site-packages/matplotlib/axes.py", line
> >>> 1591, in draw
> >>> a.draw(renderer)
> >>> File "/usr/lib/python2.4/site-packages/matplotlib/axis.py", line
> >>> 710, in draw
> >>> tick.draw(renderer)
> >>> File "/usr/lib/python2.4/site-packages/matplotlib/axis.py", line
> >>> 193, in draw
> >>> self.label1.draw(renderer)
> >>> File "/usr/lib/python2.4/site-packages/matplotlib/text.py", line
> >>> 448, in draw
> >>> bbox, info = self._get_layout(renderer)
> >>> File "/usr/lib/python2.4/site-packages/matplotlib/text.py", line
> >>> 251, in _get_layout
> >>> w, h, d = renderer.get_text_width_height_descent(
> >>> File
> >>> "/usr/lib/python2.4/site-
> >>>
> >> packages/matplotlib/backends/backend_agg.py",
> >>
> >>> line 150, in get_text_width_height_descent
> >>> Z = texmanager.get_grey(s, size, self.dpi)
> >>> File "/usr/lib/python2.4/site-packages/matplotlib/texmanager.py",
> >>> line 383, in get_grey
> >>> pngfile = self.make_png(tex, fontsize, dpi)
> >>> File "/usr/lib/python2.4/site-packages/matplotlib/texmanager.py",
> >>> line 312, in make_png
> >>> dvifile = self.make_dvi(tex, fontsize)
> >>> File "/usr/lib/python2.4/site-packages/matplotlib/texmanager.py",
> >>> line 275, in make_dvi
> >>> texfile = self.make_tex(tex, fontsize)
> >>> File "/usr/lib/python2.4/site-packages/matplotlib/texmanager.py",
> >>> line 254, in make_tex
> >>> fh.write(s)
> >>> UnicodeEncodeError: 'ascii' codec can't encode character u'\xb0' in
> >>> position 300: ordinal not in range(128)
> >>>
> >>> Any idea ?
> >>>
> >>> Nils
> >>>
> >>> -------------------------------------------------------------------
> --
> >>>
> >> ---
> >>
> >>> -------------------------------------------------------------------
> --
> >>>
> >> ----
> >>
> >>> This SF.Net email is sponsored by the Moblin Your Move Developer's
> >>>
> >> challenge
> >>
> >>> Build the coolest Linux based applications with Moblin SDK & win
> >>>
> >> great prizes
> >>
> >>> Grand prize is a trip for two to an Open Source event anywhere in
> the
> >>>
> >> world
> >>
> >>> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> >>> -------------------------------------------------------------------
> --
> >>>
> >> ---
> >>
> >>> _______________________________________________
> >>> Matplotlib-users mailing list
> >>> Mat...@li...
> >>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> >>>
> >> --
> >> Michael Droettboom
> >> Science Software Branch
> >> Operations and Engineering Division
> >> Space Telescope Science Institute
> >> Operated by AURA for NASA
> >>
> >>
> >> --------------------------------------------------------------------
> ---
> >> --
> >> This SF.Net email is sponsored by the Moblin Your Move Developer's
> >> challenge
> >> Build the coolest Linux based applications with Moblin SDK & win
> great
> >> prizes
> >> Grand prize is a trip for two to an Open Source event anywhere in
> the
> >> world
> >> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> >> _______________________________________________
> >> Matplotlib-users mailing list
> >> Mat...@li...
> >> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> >>
> >> No virus found in this incoming message.
> >> Checked by AVG - http://www.avg.com
> >> Version: 8.0.175 / Virus Database: 270.9.10/1811 - Release Date:
> >> 11/25/2008 8:29 AM
> >>
> >
> > ---------------------------------------------------------------------
> ----
> > This SF.Net email is sponsored by the Moblin Your Move Developer's
> challenge
> > Build the coolest Linux based applications with Moblin SDK & win
> great prizes
> > Grand prize is a trip for two to an Open Source event anywhere in the
> world
> > http://moblin-contest.org/redirect.php?banner_id=100&url=/
> > _______________________________________________
> > Matplotlib-users mailing list
> > Mat...@li...
> > https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> >
>
> --
> Michael Droettboom
> Science Software Branch
> Operations and Engineering Division
> Space Telescope Science Institute
> Operated by AURA for NASA
>
>
> No virus found in this incoming message.
> Checked by AVG - http://www.avg.com
> Version: 8.0.175 / Virus Database: 270.9.10/1811 - Release Date:
> 11/25/2008 8:29 AM
|
|
From: John H. <jd...@gm...> - 2008-11-25 21:16:07
|
On Tue, Nov 25, 2008 at 2:40 PM, Drain, Theodore R
<the...@jp...> wrote:
> Michael,
> I think the issue is that there is no Unicode in the script that was attached - it's just a simple polar call so the user isn't really Unicode".
>
> I think Unicode is starting to creep into the source in various places - we just had a user point out that negative numbers are using a normal negative sign ('-1.2') anymore but some kind of Unicode dash that's a lot bigger than the normal one. I wonder if this could be related...
>
> (If it matters, most of our users would rather have just the regular negative sign and not embedded Unicode in the axis labels - it looks wrong to them and makes doing any kind of processing of axis labels more difficult).
This was supposed to be a feature not a bug. As far as I understand,
we are now using the proper minus sign which has the same width as the
horizontal part or a plus sign. See
http://en.wikipedia.org/wiki/Plus_sign#Plus_sign
in the section "Character codes". The hyphen, which doubles as a
minus sign in the ascii character set, is not the proper character for
typesetting.
I don't think this is the problem Nils is having, because the
character code for the minus sign is different (and in the formatter,
we explicitly convert this if usetex is True) in the
ScalarFormatter.fix_minus method.
If the unicode minus is sufficiently problematic for you, I can add an
rc param. Something like
axis.unicode_minus : True
The problem here appears to be in
matplotlib.projects.polar.ThetaFormatter.__call__, which uses the
degree symbol. I think all we need to do is return the proper tex
string in this case. Michael, does this look right to you:
def __call__(self, x, pos=None):
# \u00b0 : degree symbol
if rcParams['text.usetex'] and not rcParams['text.latex.unicode']:
return r"$%d^\circ$" % ((x / npy.pi) * 180.0)
else:
return u"%d\u00b0" % ((x / npy.pi) * 180.0)
|
|
From: Tim M. <tim...@gm...> - 2008-11-25 21:12:27
|
Hello! > I am attaching the current version of source code plus a screenshot. I would like to ask you why you are trying to implement this by yourself in wxPython/matplotlib. There are already two pythonised applications that may be used for your purpose. And they are aware of the projections and different geographical formats: * QGIS with Pythons libary and plugins: http://qgis.org/content/view/145/113/ * Thuban: http://thuban.intevation.org/ Maybe this could save you some work/time. Kind regards, Timmie |
|
From: Michael D. <md...@st...> - 2008-11-25 21:06:35
|
Drain, Theodore R wrote:
> Michael,
> I think the issue is that there is no Unicode in the script that was attached - it's just a simple polar call so the user isn't really Unicode".
>
Polar plots always use Unicode by default for the degree sign. It would
be crazy to try to do those things without Unicode. The problem at hand
here is only when usetex is on and text.latex.unicode is False. I think
it's perhaps time to adjust the default on the latter to True to avoid
this issue -- but someone more familiar with usetex should comment on that.
> I think Unicode is starting to creep into the source in various places
Use of Unicode characters in output has existed for some time. There
is, however, no Unicode in the source files (something we've had
transiently but have addressed), because it does cause a problem with
some editors. I think that's a reasonable style guideline, but avoiding
Unicode in the output is not. I personally put in a lot of work to
support Unicode in all the backends -- it allows the output to be richer
and more like traditional typesetting rather than being stuck with the
limitations imposed by 7-bit ASCII, which is the only reasonable
alternative.
> - we just had a user point out that negative numbers are using a normal negative sign ('-1.2') anymore but some kind of Unicode dash that's a lot bigger than the normal one. I wonder if this could be related...
>
Yes, it's another instance of the same thing. (Though if usetex is
True, we don't have this specific problem, since TeX has always done
this substitution for us and matplotlib doesn't do the hyphen/minus
correction.)
> (If it matters, most of our users would rather have just the regular negative sign and not embedded Unicode in the axis labels - it looks wrong to them and makes doing any kind of processing of axis labels more difficult).
>
I think that's a matter user preference, and perhaps should be exposed
as an rcParam. Personally, it's always bothers me to see TeX-typeset
papers where the math expressions have proper minus signs, but the plots
use a hyphen. But maybe I'm too bothered by these things... ;)
As for processing the axis labels, there are far hairier things (such as
scientific notation) that make processing axis labels as strings in the
general case difficult. If you need their positions as numeric values,
one can simply use get_majorticklocs() and get an array of floats.
Cheers,
Mike
> Ted
>
>
>> -----Original Message-----
>> From: Michael Droettboom [mailto:md...@st...]
>> Sent: Tuesday, November 25, 2008 12:25 PM
>> To: Nils Wagner
>> Cc: mat...@li...
>> Subject: Re: [Matplotlib-users] polar
>>
>> It says:
>>
>> "You are using unicode and latex, but have not enabled the matplotlib
>> 'text.latex.unicode' rcParam."
>>
>> Does setting text.latex.unicode to True resolve the issue?
>>
>> Maybe that message should be made more prominent -- it currently is
>> only
>> displayed when verbose is turned on, but it really is an exception.
>> Maybe that message should be raised, rather than reraising the original
>> one there.
>>
>> Mike
>>
>> Nils Wagner wrote:
>>
>>> Hi all,
>>>
>>> If I run the attached example I get
>>>
>>> python -i test_polar.py --verbose-helpful
>>> $HOME=/home/nwagner
>>> matplotlib data path /usr/lib/python2.4/site-packages/matplotlib/mpl-
>>>
>> data
>>
>>> loaded rc file /home/nwagner/matplotlibrc
>>> matplotlib version 0.98.3
>>> verbose.level helpful
>>> interactive is False
>>> units is False
>>> platform is linux2
>>> CONFIGDIR=/home/nwagner/.matplotlib
>>> Using fontManager instance from
>>>
>> /home/nwagner/.matplotlib/fontList.cache
>>
>>> backend WXAgg version 2.5.3.1
>>> findfont: Matching
>>> :family=sans-
>>>
>> serif:style=normal:variant=normal:weight=normal:stretch=normal:size=med
>> ium
>>
>>> to Bitstream Vera Sans
>>> (/usr/lib/python2.4/site-packages/matplotlib/mpl-
>>>
>> data/fonts/ttf/Vera.ttf)
>>
>>> with score of 1.000000
>>> Found dvipng version 1.5
>>> You are using unicode and latex, but have not enabled the matplotlib
>>> 'text.latex.unicode' rcParam.
>>> Traceback (most recent call last):
>>> File
>>> "/usr/lib/python2.4/site-packages/matplotlib/backends/backend_wx.py",
>>> line 1121, in _onPaint
>>> self.draw(drawDC=drawDC)
>>> File
>>> "/usr/lib/python2.4/site-
>>>
>> packages/matplotlib/backends/backend_wxagg.py",
>>
>>> line 60, in draw
>>> FigureCanvasAgg.draw(self)
>>> File
>>> "/usr/lib/python2.4/site-
>>>
>> packages/matplotlib/backends/backend_agg.py",
>>
>>> line 283, in draw
>>> self.figure.draw(self.renderer)
>>> File "/usr/lib/python2.4/site-packages/matplotlib/figure.py", line
>>> 767, in draw
>>> for a in self.axes: a.draw(renderer)
>>> File "/usr/lib/python2.4/site-packages/matplotlib/axes.py", line
>>> 1591, in draw
>>> a.draw(renderer)
>>> File "/usr/lib/python2.4/site-packages/matplotlib/axis.py", line
>>> 710, in draw
>>> tick.draw(renderer)
>>> File "/usr/lib/python2.4/site-packages/matplotlib/axis.py", line
>>> 193, in draw
>>> self.label1.draw(renderer)
>>> File "/usr/lib/python2.4/site-packages/matplotlib/text.py", line
>>> 448, in draw
>>> bbox, info = self._get_layout(renderer)
>>> File "/usr/lib/python2.4/site-packages/matplotlib/text.py", line
>>> 251, in _get_layout
>>> w, h, d = renderer.get_text_width_height_descent(
>>> File
>>> "/usr/lib/python2.4/site-
>>>
>> packages/matplotlib/backends/backend_agg.py",
>>
>>> line 150, in get_text_width_height_descent
>>> Z = texmanager.get_grey(s, size, self.dpi)
>>> File "/usr/lib/python2.4/site-packages/matplotlib/texmanager.py",
>>> line 383, in get_grey
>>> pngfile = self.make_png(tex, fontsize, dpi)
>>> File "/usr/lib/python2.4/site-packages/matplotlib/texmanager.py",
>>> line 312, in make_png
>>> dvifile = self.make_dvi(tex, fontsize)
>>> File "/usr/lib/python2.4/site-packages/matplotlib/texmanager.py",
>>> line 275, in make_dvi
>>> texfile = self.make_tex(tex, fontsize)
>>> File "/usr/lib/python2.4/site-packages/matplotlib/texmanager.py",
>>> line 254, in make_tex
>>> fh.write(s)
>>> UnicodeEncodeError: 'ascii' codec can't encode character u'\xb0' in
>>> position 300: ordinal not in range(128)
>>> You are using unicode and latex, but have not enabled the matplotlib
>>> 'text.latex.unicode' rcParam.
>>> Traceback (most recent call last):
>>> File
>>> "/usr/lib/python2.4/site-packages/matplotlib/backends/backend_wx.py",
>>> line 1121, in _onPaint
>>> self.draw(drawDC=drawDC)
>>> File
>>> "/usr/lib/python2.4/site-
>>>
>> packages/matplotlib/backends/backend_wxagg.py",
>>
>>> line 60, in draw
>>> FigureCanvasAgg.draw(self)
>>> File
>>> "/usr/lib/python2.4/site-
>>>
>> packages/matplotlib/backends/backend_agg.py",
>>
>>> line 283, in draw
>>> self.figure.draw(self.renderer)
>>> File "/usr/lib/python2.4/site-packages/matplotlib/figure.py", line
>>> 767, in draw
>>> for a in self.axes: a.draw(renderer)
>>> File "/usr/lib/python2.4/site-packages/matplotlib/axes.py", line
>>> 1591, in draw
>>> a.draw(renderer)
>>> File "/usr/lib/python2.4/site-packages/matplotlib/axis.py", line
>>> 710, in draw
>>> tick.draw(renderer)
>>> File "/usr/lib/python2.4/site-packages/matplotlib/axis.py", line
>>> 193, in draw
>>> self.label1.draw(renderer)
>>> File "/usr/lib/python2.4/site-packages/matplotlib/text.py", line
>>> 448, in draw
>>> bbox, info = self._get_layout(renderer)
>>> File "/usr/lib/python2.4/site-packages/matplotlib/text.py", line
>>> 251, in _get_layout
>>> w, h, d = renderer.get_text_width_height_descent(
>>> File
>>> "/usr/lib/python2.4/site-
>>>
>> packages/matplotlib/backends/backend_agg.py",
>>
>>> line 150, in get_text_width_height_descent
>>> Z = texmanager.get_grey(s, size, self.dpi)
>>> File "/usr/lib/python2.4/site-packages/matplotlib/texmanager.py",
>>> line 383, in get_grey
>>> pngfile = self.make_png(tex, fontsize, dpi)
>>> File "/usr/lib/python2.4/site-packages/matplotlib/texmanager.py",
>>> line 312, in make_png
>>> dvifile = self.make_dvi(tex, fontsize)
>>> File "/usr/lib/python2.4/site-packages/matplotlib/texmanager.py",
>>> line 275, in make_dvi
>>> texfile = self.make_tex(tex, fontsize)
>>> File "/usr/lib/python2.4/site-packages/matplotlib/texmanager.py",
>>> line 254, in make_tex
>>> fh.write(s)
>>> UnicodeEncodeError: 'ascii' codec can't encode character u'\xb0' in
>>> position 300: ordinal not in range(128)
>>>
>>> Any idea ?
>>>
>>> Nils
>>>
>>> ---------------------------------------------------------------------
>>>
>> ---
>>
>>> ---------------------------------------------------------------------
>>>
>> ----
>>
>>> This SF.Net email is sponsored by the Moblin Your Move Developer's
>>>
>> challenge
>>
>>> Build the coolest Linux based applications with Moblin SDK & win
>>>
>> great prizes
>>
>>> Grand prize is a trip for two to an Open Source event anywhere in the
>>>
>> world
>>
>>> http://moblin-contest.org/redirect.php?banner_id=100&url=/
>>> ---------------------------------------------------------------------
>>>
>> ---
>>
>>> _______________________________________________
>>> Matplotlib-users mailing list
>>> Mat...@li...
>>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>>
>> --
>> Michael Droettboom
>> Science Software Branch
>> Operations and Engineering Division
>> Space Telescope Science Institute
>> Operated by AURA for NASA
>>
>>
>> -----------------------------------------------------------------------
>> --
>> This SF.Net email is sponsored by the Moblin Your Move Developer's
>> challenge
>> Build the coolest Linux based applications with Moblin SDK & win great
>> prizes
>> Grand prize is a trip for two to an Open Source event anywhere in the
>> world
>> http://moblin-contest.org/redirect.php?banner_id=100&url=/
>> _______________________________________________
>> Matplotlib-users mailing list
>> Mat...@li...
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>
>> No virus found in this incoming message.
>> Checked by AVG - http://www.avg.com
>> Version: 8.0.175 / Virus Database: 270.9.10/1811 - Release Date:
>> 11/25/2008 8:29 AM
>>
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
> Build the coolest Linux based applications with Moblin SDK & win great prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
--
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA
|
|
From: Drain, T. R <the...@jp...> - 2008-11-25 20:41:14
|
Michael,
I think the issue is that there is no Unicode in the script that was attached - it's just a simple polar call so the user isn't really Unicode".
I think Unicode is starting to creep into the source in various places - we just had a user point out that negative numbers are using a normal negative sign ('-1.2') anymore but some kind of Unicode dash that's a lot bigger than the normal one. I wonder if this could be related...
(If it matters, most of our users would rather have just the regular negative sign and not embedded Unicode in the axis labels - it looks wrong to them and makes doing any kind of processing of axis labels more difficult).
Ted
> -----Original Message-----
> From: Michael Droettboom [mailto:md...@st...]
> Sent: Tuesday, November 25, 2008 12:25 PM
> To: Nils Wagner
> Cc: mat...@li...
> Subject: Re: [Matplotlib-users] polar
>
> It says:
>
> "You are using unicode and latex, but have not enabled the matplotlib
> 'text.latex.unicode' rcParam."
>
> Does setting text.latex.unicode to True resolve the issue?
>
> Maybe that message should be made more prominent -- it currently is
> only
> displayed when verbose is turned on, but it really is an exception.
> Maybe that message should be raised, rather than reraising the original
> one there.
>
> Mike
>
> Nils Wagner wrote:
> > Hi all,
> >
> > If I run the attached example I get
> >
> > python -i test_polar.py --verbose-helpful
> > $HOME=/home/nwagner
> > matplotlib data path /usr/lib/python2.4/site-packages/matplotlib/mpl-
> data
> > loaded rc file /home/nwagner/matplotlibrc
> > matplotlib version 0.98.3
> > verbose.level helpful
> > interactive is False
> > units is False
> > platform is linux2
> > CONFIGDIR=/home/nwagner/.matplotlib
> > Using fontManager instance from
> /home/nwagner/.matplotlib/fontList.cache
> > backend WXAgg version 2.5.3.1
> > findfont: Matching
> > :family=sans-
> serif:style=normal:variant=normal:weight=normal:stretch=normal:size=med
> ium
> > to Bitstream Vera Sans
> > (/usr/lib/python2.4/site-packages/matplotlib/mpl-
> data/fonts/ttf/Vera.ttf)
> > with score of 1.000000
> > Found dvipng version 1.5
> > You are using unicode and latex, but have not enabled the matplotlib
> > 'text.latex.unicode' rcParam.
> > Traceback (most recent call last):
> > File
> > "/usr/lib/python2.4/site-packages/matplotlib/backends/backend_wx.py",
> > line 1121, in _onPaint
> > self.draw(drawDC=drawDC)
> > File
> > "/usr/lib/python2.4/site-
> packages/matplotlib/backends/backend_wxagg.py",
> > line 60, in draw
> > FigureCanvasAgg.draw(self)
> > File
> > "/usr/lib/python2.4/site-
> packages/matplotlib/backends/backend_agg.py",
> > line 283, in draw
> > self.figure.draw(self.renderer)
> > File "/usr/lib/python2.4/site-packages/matplotlib/figure.py", line
> > 767, in draw
> > for a in self.axes: a.draw(renderer)
> > File "/usr/lib/python2.4/site-packages/matplotlib/axes.py", line
> > 1591, in draw
> > a.draw(renderer)
> > File "/usr/lib/python2.4/site-packages/matplotlib/axis.py", line
> > 710, in draw
> > tick.draw(renderer)
> > File "/usr/lib/python2.4/site-packages/matplotlib/axis.py", line
> > 193, in draw
> > self.label1.draw(renderer)
> > File "/usr/lib/python2.4/site-packages/matplotlib/text.py", line
> > 448, in draw
> > bbox, info = self._get_layout(renderer)
> > File "/usr/lib/python2.4/site-packages/matplotlib/text.py", line
> > 251, in _get_layout
> > w, h, d = renderer.get_text_width_height_descent(
> > File
> > "/usr/lib/python2.4/site-
> packages/matplotlib/backends/backend_agg.py",
> > line 150, in get_text_width_height_descent
> > Z = texmanager.get_grey(s, size, self.dpi)
> > File "/usr/lib/python2.4/site-packages/matplotlib/texmanager.py",
> > line 383, in get_grey
> > pngfile = self.make_png(tex, fontsize, dpi)
> > File "/usr/lib/python2.4/site-packages/matplotlib/texmanager.py",
> > line 312, in make_png
> > dvifile = self.make_dvi(tex, fontsize)
> > File "/usr/lib/python2.4/site-packages/matplotlib/texmanager.py",
> > line 275, in make_dvi
> > texfile = self.make_tex(tex, fontsize)
> > File "/usr/lib/python2.4/site-packages/matplotlib/texmanager.py",
> > line 254, in make_tex
> > fh.write(s)
> > UnicodeEncodeError: 'ascii' codec can't encode character u'\xb0' in
> > position 300: ordinal not in range(128)
> > You are using unicode and latex, but have not enabled the matplotlib
> > 'text.latex.unicode' rcParam.
> > Traceback (most recent call last):
> > File
> > "/usr/lib/python2.4/site-packages/matplotlib/backends/backend_wx.py",
> > line 1121, in _onPaint
> > self.draw(drawDC=drawDC)
> > File
> > "/usr/lib/python2.4/site-
> packages/matplotlib/backends/backend_wxagg.py",
> > line 60, in draw
> > FigureCanvasAgg.draw(self)
> > File
> > "/usr/lib/python2.4/site-
> packages/matplotlib/backends/backend_agg.py",
> > line 283, in draw
> > self.figure.draw(self.renderer)
> > File "/usr/lib/python2.4/site-packages/matplotlib/figure.py", line
> > 767, in draw
> > for a in self.axes: a.draw(renderer)
> > File "/usr/lib/python2.4/site-packages/matplotlib/axes.py", line
> > 1591, in draw
> > a.draw(renderer)
> > File "/usr/lib/python2.4/site-packages/matplotlib/axis.py", line
> > 710, in draw
> > tick.draw(renderer)
> > File "/usr/lib/python2.4/site-packages/matplotlib/axis.py", line
> > 193, in draw
> > self.label1.draw(renderer)
> > File "/usr/lib/python2.4/site-packages/matplotlib/text.py", line
> > 448, in draw
> > bbox, info = self._get_layout(renderer)
> > File "/usr/lib/python2.4/site-packages/matplotlib/text.py", line
> > 251, in _get_layout
> > w, h, d = renderer.get_text_width_height_descent(
> > File
> > "/usr/lib/python2.4/site-
> packages/matplotlib/backends/backend_agg.py",
> > line 150, in get_text_width_height_descent
> > Z = texmanager.get_grey(s, size, self.dpi)
> > File "/usr/lib/python2.4/site-packages/matplotlib/texmanager.py",
> > line 383, in get_grey
> > pngfile = self.make_png(tex, fontsize, dpi)
> > File "/usr/lib/python2.4/site-packages/matplotlib/texmanager.py",
> > line 312, in make_png
> > dvifile = self.make_dvi(tex, fontsize)
> > File "/usr/lib/python2.4/site-packages/matplotlib/texmanager.py",
> > line 275, in make_dvi
> > texfile = self.make_tex(tex, fontsize)
> > File "/usr/lib/python2.4/site-packages/matplotlib/texmanager.py",
> > line 254, in make_tex
> > fh.write(s)
> > UnicodeEncodeError: 'ascii' codec can't encode character u'\xb0' in
> > position 300: ordinal not in range(128)
> >
> > Any idea ?
> >
> > Nils
> >
> > ---------------------------------------------------------------------
> ---
> >
> > ---------------------------------------------------------------------
> ----
> > This SF.Net email is sponsored by the Moblin Your Move Developer's
> challenge
> > Build the coolest Linux based applications with Moblin SDK & win
> great prizes
> > Grand prize is a trip for two to an Open Source event anywhere in the
> world
> > http://moblin-contest.org/redirect.php?banner_id=100&url=/
> > ---------------------------------------------------------------------
> ---
> >
> > _______________________________________________
> > Matplotlib-users mailing list
> > Mat...@li...
> > https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
> --
> Michael Droettboom
> Science Software Branch
> Operations and Engineering Division
> Space Telescope Science Institute
> Operated by AURA for NASA
>
>
> -----------------------------------------------------------------------
> --
> This SF.Net email is sponsored by the Moblin Your Move Developer's
> challenge
> Build the coolest Linux based applications with Moblin SDK & win great
> prizes
> Grand prize is a trip for two to an Open Source event anywhere in the
> world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
> No virus found in this incoming message.
> Checked by AVG - http://www.avg.com
> Version: 8.0.175 / Virus Database: 270.9.10/1811 - Release Date:
> 11/25/2008 8:29 AM
|
|
From: Michael D. <md...@st...> - 2008-11-25 20:25:59
|
It says: "You are using unicode and latex, but have not enabled the matplotlib 'text.latex.unicode' rcParam." Does setting text.latex.unicode to True resolve the issue? Maybe that message should be made more prominent -- it currently is only displayed when verbose is turned on, but it really is an exception. Maybe that message should be raised, rather than reraising the original one there. Mike Nils Wagner wrote: > Hi all, > > If I run the attached example I get > > python -i test_polar.py --verbose-helpful > $HOME=/home/nwagner > matplotlib data path /usr/lib/python2.4/site-packages/matplotlib/mpl-data > loaded rc file /home/nwagner/matplotlibrc > matplotlib version 0.98.3 > verbose.level helpful > interactive is False > units is False > platform is linux2 > CONFIGDIR=/home/nwagner/.matplotlib > Using fontManager instance from /home/nwagner/.matplotlib/fontList.cache > backend WXAgg version 2.5.3.1 > findfont: Matching > :family=sans-serif:style=normal:variant=normal:weight=normal:stretch=normal:size=medium > to Bitstream Vera Sans > (/usr/lib/python2.4/site-packages/matplotlib/mpl-data/fonts/ttf/Vera.ttf) > with score of 1.000000 > Found dvipng version 1.5 > You are using unicode and latex, but have not enabled the matplotlib > 'text.latex.unicode' rcParam. > Traceback (most recent call last): > File > "/usr/lib/python2.4/site-packages/matplotlib/backends/backend_wx.py", > line 1121, in _onPaint > self.draw(drawDC=drawDC) > File > "/usr/lib/python2.4/site-packages/matplotlib/backends/backend_wxagg.py", > line 60, in draw > FigureCanvasAgg.draw(self) > File > "/usr/lib/python2.4/site-packages/matplotlib/backends/backend_agg.py", > line 283, in draw > self.figure.draw(self.renderer) > File "/usr/lib/python2.4/site-packages/matplotlib/figure.py", line > 767, in draw > for a in self.axes: a.draw(renderer) > File "/usr/lib/python2.4/site-packages/matplotlib/axes.py", line > 1591, in draw > a.draw(renderer) > File "/usr/lib/python2.4/site-packages/matplotlib/axis.py", line > 710, in draw > tick.draw(renderer) > File "/usr/lib/python2.4/site-packages/matplotlib/axis.py", line > 193, in draw > self.label1.draw(renderer) > File "/usr/lib/python2.4/site-packages/matplotlib/text.py", line > 448, in draw > bbox, info = self._get_layout(renderer) > File "/usr/lib/python2.4/site-packages/matplotlib/text.py", line > 251, in _get_layout > w, h, d = renderer.get_text_width_height_descent( > File > "/usr/lib/python2.4/site-packages/matplotlib/backends/backend_agg.py", > line 150, in get_text_width_height_descent > Z = texmanager.get_grey(s, size, self.dpi) > File "/usr/lib/python2.4/site-packages/matplotlib/texmanager.py", > line 383, in get_grey > pngfile = self.make_png(tex, fontsize, dpi) > File "/usr/lib/python2.4/site-packages/matplotlib/texmanager.py", > line 312, in make_png > dvifile = self.make_dvi(tex, fontsize) > File "/usr/lib/python2.4/site-packages/matplotlib/texmanager.py", > line 275, in make_dvi > texfile = self.make_tex(tex, fontsize) > File "/usr/lib/python2.4/site-packages/matplotlib/texmanager.py", > line 254, in make_tex > fh.write(s) > UnicodeEncodeError: 'ascii' codec can't encode character u'\xb0' in > position 300: ordinal not in range(128) > You are using unicode and latex, but have not enabled the matplotlib > 'text.latex.unicode' rcParam. > Traceback (most recent call last): > File > "/usr/lib/python2.4/site-packages/matplotlib/backends/backend_wx.py", > line 1121, in _onPaint > self.draw(drawDC=drawDC) > File > "/usr/lib/python2.4/site-packages/matplotlib/backends/backend_wxagg.py", > line 60, in draw > FigureCanvasAgg.draw(self) > File > "/usr/lib/python2.4/site-packages/matplotlib/backends/backend_agg.py", > line 283, in draw > self.figure.draw(self.renderer) > File "/usr/lib/python2.4/site-packages/matplotlib/figure.py", line > 767, in draw > for a in self.axes: a.draw(renderer) > File "/usr/lib/python2.4/site-packages/matplotlib/axes.py", line > 1591, in draw > a.draw(renderer) > File "/usr/lib/python2.4/site-packages/matplotlib/axis.py", line > 710, in draw > tick.draw(renderer) > File "/usr/lib/python2.4/site-packages/matplotlib/axis.py", line > 193, in draw > self.label1.draw(renderer) > File "/usr/lib/python2.4/site-packages/matplotlib/text.py", line > 448, in draw > bbox, info = self._get_layout(renderer) > File "/usr/lib/python2.4/site-packages/matplotlib/text.py", line > 251, in _get_layout > w, h, d = renderer.get_text_width_height_descent( > File > "/usr/lib/python2.4/site-packages/matplotlib/backends/backend_agg.py", > line 150, in get_text_width_height_descent > Z = texmanager.get_grey(s, size, self.dpi) > File "/usr/lib/python2.4/site-packages/matplotlib/texmanager.py", > line 383, in get_grey > pngfile = self.make_png(tex, fontsize, dpi) > File "/usr/lib/python2.4/site-packages/matplotlib/texmanager.py", > line 312, in make_png > dvifile = self.make_dvi(tex, fontsize) > File "/usr/lib/python2.4/site-packages/matplotlib/texmanager.py", > line 275, in make_dvi > texfile = self.make_tex(tex, fontsize) > File "/usr/lib/python2.4/site-packages/matplotlib/texmanager.py", > line 254, in make_tex > fh.write(s) > UnicodeEncodeError: 'ascii' codec can't encode character u'\xb0' in > position 300: ordinal not in range(128) > > Any idea ? > > Nils > > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's challenge > Build the coolest Linux based applications with Moblin SDK & win great prizes > Grand prize is a trip for two to an Open Source event anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > ------------------------------------------------------------------------ > > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Michael Droettboom Science Software Branch Operations and Engineering Division Space Telescope Science Institute Operated by AURA for NASA |
|
From: Ryan M. <rm...@gm...> - 2008-11-25 20:15:22
|
Fago, Matt - AES wrote: > [I'm not sure if this is best in 'devel' or 'users'] > > I'm trying to compute PSDs using matplotlib.mlab.psd and came across the "PSD amplitudes" thread from last year: > > http://sourceforge.net/mailarchive/message.php?msg_id=472101A6.9080206%40isla.hawaii.edu > > Using the latest version of psd on svn trunk (rev 6429) that added support for pad_to, I can now compute the Matlab pwelch > example using matplotlib. This example is given in the Signal Processing Toolbox User's Guide: > > http://www.mathworks.com/access/helpdesk/help/pdf_doc/signal/signal_tb.pdf > > (look on pages 2-23 and 2-24). Note I do not have easy access to Matlab itself, so I'm just using this published example. > > The Matlab code is as follows: > > randn('state',1) > fs = 1000; % Sampling frequency > t = (0:0.3*fs)./fs; % 301 samples > A = [2 8]; % Sinusoid amplitudes (row vector) > f = [150;140]; % Sinusoid frequencies (column vector) > xn = A*sin(2*pi*f*t) + 5*randn(size(t)); > Hs = spectrum.welch('rectangular',150,50); > psd(Hs,xn,'Fs',fs,'NFFT',512); > > This produces a fairly noisy signal from -20 to -10 dB, with a strong peak of ~6 dB at 150 Hz (see the plot on page 2-24). > > While my equivalent (?) python code is: > > from scipy import * > from mlabsvn import psd # This is a local copy of svn revision 6429 of matplotlib.mlab > from pylab import * > fs=1000 > t=linspace(0,0.3,0.3*fs+1) > A=[2,8] > f=[150,140] > xn=A[0]*sin(2*pi*f[0]*t) + A[1]*sin(2*pi*f[1]*t) + 5*randn(len(t)) > Pxx,freqs = psd(xn,Fs=fs,NFFT=150,noverlap=75,pad_to=512) > > figure() > plot(freqs, 10*log10(Pxx) ) > show() > > However, this produces a peak of over 30 dB at 150 Hz. Unless there is a mistake in my code above, there seems to be a > significant difference between the matplotlib and matlab implementations. > > I noticed that the values 10*log10(Pxx/len(xn)) produces results that match much better. Without looking more closely at the > code for psd and reviewing Bendat and Piersol I cannot be sure that this is the correct fix. > > Does anyone else have any insight? When is the next release planned, and how likely is a fix? I don't have any insight yet, but since I'm the guy who just tweaked it, I guess I'm on the hook to fix it. :) I'll try to take a look this afternoon. Ryan -- Ryan May Graduate Research Assistant School of Meteorology University of Oklahoma |
|
From: Nils W. <nw...@ia...> - 2008-11-25 20:11:13
|
Hi all,
If I run the attached example I get
python -i test_polar.py --verbose-helpful
$HOME=/home/nwagner
matplotlib data path
/usr/lib/python2.4/site-packages/matplotlib/mpl-data
loaded rc file /home/nwagner/matplotlibrc
matplotlib version 0.98.3
verbose.level helpful
interactive is False
units is False
platform is linux2
CONFIGDIR=/home/nwagner/.matplotlib
Using fontManager instance from
/home/nwagner/.matplotlib/fontList.cache
backend WXAgg version 2.5.3.1
findfont: Matching
:family=sans-serif:style=normal:variant=normal:weight=normal:stretch=normal:size=medium
to Bitstream Vera Sans
(/usr/lib/python2.4/site-packages/matplotlib/mpl-data/fonts/ttf/Vera.ttf)
with score of 1.000000
Found dvipng version 1.5
You are using unicode and latex, but have not enabled the
matplotlib 'text.latex.unicode' rcParam.
Traceback (most recent call last):
File
"/usr/lib/python2.4/site-packages/matplotlib/backends/backend_wx.py",
line 1121, in _onPaint
self.draw(drawDC=drawDC)
File
"/usr/lib/python2.4/site-packages/matplotlib/backends/backend_wxagg.py",
line 60, in draw
FigureCanvasAgg.draw(self)
File
"/usr/lib/python2.4/site-packages/matplotlib/backends/backend_agg.py",
line 283, in draw
self.figure.draw(self.renderer)
File
"/usr/lib/python2.4/site-packages/matplotlib/figure.py",
line 767, in draw
for a in self.axes: a.draw(renderer)
File
"/usr/lib/python2.4/site-packages/matplotlib/axes.py",
line 1591, in draw
a.draw(renderer)
File
"/usr/lib/python2.4/site-packages/matplotlib/axis.py",
line 710, in draw
tick.draw(renderer)
File
"/usr/lib/python2.4/site-packages/matplotlib/axis.py",
line 193, in draw
self.label1.draw(renderer)
File
"/usr/lib/python2.4/site-packages/matplotlib/text.py",
line 448, in draw
bbox, info = self._get_layout(renderer)
File
"/usr/lib/python2.4/site-packages/matplotlib/text.py",
line 251, in _get_layout
w, h, d = renderer.get_text_width_height_descent(
File
"/usr/lib/python2.4/site-packages/matplotlib/backends/backend_agg.py",
line 150, in get_text_width_height_descent
Z = texmanager.get_grey(s, size, self.dpi)
File
"/usr/lib/python2.4/site-packages/matplotlib/texmanager.py",
line 383, in get_grey
pngfile = self.make_png(tex, fontsize, dpi)
File
"/usr/lib/python2.4/site-packages/matplotlib/texmanager.py",
line 312, in make_png
dvifile = self.make_dvi(tex, fontsize)
File
"/usr/lib/python2.4/site-packages/matplotlib/texmanager.py",
line 275, in make_dvi
texfile = self.make_tex(tex, fontsize)
File
"/usr/lib/python2.4/site-packages/matplotlib/texmanager.py",
line 254, in make_tex
fh.write(s)
UnicodeEncodeError: 'ascii' codec can't encode character
u'\xb0' in position 300: ordinal not in range(128)
You are using unicode and latex, but have not enabled the
matplotlib 'text.latex.unicode' rcParam.
Traceback (most recent call last):
File
"/usr/lib/python2.4/site-packages/matplotlib/backends/backend_wx.py",
line 1121, in _onPaint
self.draw(drawDC=drawDC)
File
"/usr/lib/python2.4/site-packages/matplotlib/backends/backend_wxagg.py",
line 60, in draw
FigureCanvasAgg.draw(self)
File
"/usr/lib/python2.4/site-packages/matplotlib/backends/backend_agg.py",
line 283, in draw
self.figure.draw(self.renderer)
File
"/usr/lib/python2.4/site-packages/matplotlib/figure.py",
line 767, in draw
for a in self.axes: a.draw(renderer)
File
"/usr/lib/python2.4/site-packages/matplotlib/axes.py",
line 1591, in draw
a.draw(renderer)
File
"/usr/lib/python2.4/site-packages/matplotlib/axis.py",
line 710, in draw
tick.draw(renderer)
File
"/usr/lib/python2.4/site-packages/matplotlib/axis.py",
line 193, in draw
self.label1.draw(renderer)
File
"/usr/lib/python2.4/site-packages/matplotlib/text.py",
line 448, in draw
bbox, info = self._get_layout(renderer)
File
"/usr/lib/python2.4/site-packages/matplotlib/text.py",
line 251, in _get_layout
w, h, d = renderer.get_text_width_height_descent(
File
"/usr/lib/python2.4/site-packages/matplotlib/backends/backend_agg.py",
line 150, in get_text_width_height_descent
Z = texmanager.get_grey(s, size, self.dpi)
File
"/usr/lib/python2.4/site-packages/matplotlib/texmanager.py",
line 383, in get_grey
pngfile = self.make_png(tex, fontsize, dpi)
File
"/usr/lib/python2.4/site-packages/matplotlib/texmanager.py",
line 312, in make_png
dvifile = self.make_dvi(tex, fontsize)
File
"/usr/lib/python2.4/site-packages/matplotlib/texmanager.py",
line 275, in make_dvi
texfile = self.make_tex(tex, fontsize)
File
"/usr/lib/python2.4/site-packages/matplotlib/texmanager.py",
line 254, in make_tex
fh.write(s)
UnicodeEncodeError: 'ascii' codec can't encode character
u'\xb0' in position 300: ordinal not in range(128)
Any idea ?
Nils
|
|
From: Fago, M. - A. <Mat...@it...> - 2008-11-25 20:05:17
|
[I'm not sure if this is best in 'devel' or 'users'] I'm trying to compute PSDs using matplotlib.mlab.psd and came across the "PSD amplitudes" thread from last year: http://sourceforge.net/mailarchive/message.php?msg_id=472101A6.9080206%40isla.hawaii.edu Using the latest version of psd on svn trunk (rev 6429) that added support for pad_to, I can now compute the Matlab pwelch example using matplotlib. This example is given in the Signal Processing Toolbox User's Guide: http://www.mathworks.com/access/helpdesk/help/pdf_doc/signal/signal_tb.pdf (look on pages 2-23 and 2-24). Note I do not have easy access to Matlab itself, so I'm just using this published example. The Matlab code is as follows: randn('state',1) fs = 1000; % Sampling frequency t = (0:0.3*fs)./fs; % 301 samples A = [2 8]; % Sinusoid amplitudes (row vector) f = [150;140]; % Sinusoid frequencies (column vector) xn = A*sin(2*pi*f*t) + 5*randn(size(t)); Hs = spectrum.welch('rectangular',150,50); psd(Hs,xn,'Fs',fs,'NFFT',512); This produces a fairly noisy signal from -20 to -10 dB, with a strong peak of ~6 dB at 150 Hz (see the plot on page 2-24). While my equivalent (?) python code is: from scipy import * from mlabsvn import psd # This is a local copy of svn revision 6429 of matplotlib.mlab from pylab import * fs=1000 t=linspace(0,0.3,0.3*fs+1) A=[2,8] f=[150,140] xn=A[0]*sin(2*pi*f[0]*t) + A[1]*sin(2*pi*f[1]*t) + 5*randn(len(t)) Pxx,freqs = psd(xn,Fs=fs,NFFT=150,noverlap=75,pad_to=512) figure() plot(freqs, 10*log10(Pxx) ) show() However, this produces a peak of over 30 dB at 150 Hz. Unless there is a mistake in my code above, there seems to be a significant difference between the matplotlib and matlab implementations. I noticed that the values 10*log10(Pxx/len(xn)) produces results that match much better. Without looking more closely at the code for psd and reviewing Bendat and Piersol I cannot be sure that this is the correct fix. Does anyone else have any insight? When is the next release planned, and how likely is a fix? Thanks, Matt This e-mail and any files transmitted with it may be proprietary and are intended solely for the use of the individual or entity to whom they are addressed. If you have received this e-mail in error please notify the sender. Please note that any views or opinions presented in this e-mail are solely those of the author and do not necessarily represent those of ITT Corporation. The recipient should check this e-mail and any attachments for the presence of viruses. ITT accepts no liability for any damage caused by any virus transmitted by this e-mail. |
|
From: Michael D. <md...@st...> - 2008-11-25 15:25:57
|
I introduced this bug trying to fix the Cairo backend on Nov 12.
(r6400). It should now be fixed in SVN r6446. You will need to remove
~/.matplotlibrc/fontList.cache for the fix to take effect.
Mike
Michael Droettboom wrote:
> I'm seeing this here, too. Something must have been messed up recently
> in SVN. I'm looking into it.
>
> Mike
>
> Zane Selvans wrote:
>
>>> We have two modes to render latex -- one is native TeX layout and uses
>>> latex and dvipng, and is superior if you need all of TeX's
>>> capabilities (eg an eqnarray), but the fonts are suboptimal. The
>>> other is mathtext, which will cover 98% of most users' math needs,
>>> does not require a latex install because it is pure mpl, and uses
>>> nicer fonts .
>>>
>> Well, if I turn off usetex, then the LaTeX symbols don't get rendered
>> correctly. It's obviously trying to do something other than just
>> write out the plain text, but it's not doing the right thing. I quit
>> out of matplotlib, and re-purged all the cached stuff from my
>> .matplotlib directory, and it's still failing. From the docs, it
>> sounds like mathtext is just the default way for Text objects to get
>> rendered. It fails the same way irrespective of whether I use a raw
>> string, or a double-quoted string:
>>
>> fit_ax.set_ylabel(r'$\delta_{rms}$ [degrees]')
>> fit_ax.set_ylabel("$\delta_{rms}$ [degrees]")
>>
>> both give a capital 'C' with a subscript 'rms'
>>
>> $\bar{D}$ results in a capital D with a little circle over it.
>>
>> $20^\circ$ yields 20 raised to the little tiny 'e' power.
>> Even if I wipe my site-packages/matplotlib* directory and egg-info,
>> make clean, and recompile and install matplotlib from the SVN source,
>> I still get the same problem. I don't know if it means anything, but
>> I note that the mpl-data/fonts directory in SVN has 282 sub-entries,
>> and the mpl-data/fonts directory that's getting installed in my
>> site-packages only has 99 sub-entries. But maybe they aren't supposed
>> to be the same? Dunno.
>> So for now I can only get my math symbols to render with text.usetext
>> turned on.
>>
> I'm seeing
>
>
--
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA
|
|
From: Michael D. <md...@st...> - 2008-11-25 15:15:35
|
I'm seeing this here, too. Something must have been messed up recently
in SVN. I'm looking into it.
Mike
Zane Selvans wrote:
>> We have two modes to render latex -- one is native TeX layout and uses
>> latex and dvipng, and is superior if you need all of TeX's
>> capabilities (eg an eqnarray), but the fonts are suboptimal. The
>> other is mathtext, which will cover 98% of most users' math needs,
>> does not require a latex install because it is pure mpl, and uses
>> nicer fonts .
>
> Well, if I turn off usetex, then the LaTeX symbols don't get rendered
> correctly. It's obviously trying to do something other than just
> write out the plain text, but it's not doing the right thing. I quit
> out of matplotlib, and re-purged all the cached stuff from my
> .matplotlib directory, and it's still failing. From the docs, it
> sounds like mathtext is just the default way for Text objects to get
> rendered. It fails the same way irrespective of whether I use a raw
> string, or a double-quoted string:
>
> fit_ax.set_ylabel(r'$\delta_{rms}$ [degrees]')
> fit_ax.set_ylabel("$\delta_{rms}$ [degrees]")
>
> both give a capital 'C' with a subscript 'rms'
>
> $\bar{D}$ results in a capital D with a little circle over it.
>
> $20^\circ$ yields 20 raised to the little tiny 'e' power.
> Even if I wipe my site-packages/matplotlib* directory and egg-info,
> make clean, and recompile and install matplotlib from the SVN source,
> I still get the same problem. I don't know if it means anything, but
> I note that the mpl-data/fonts directory in SVN has 282 sub-entries,
> and the mpl-data/fonts directory that's getting installed in my
> site-packages only has 99 sub-entries. But maybe they aren't supposed
> to be the same? Dunno.
> So for now I can only get my math symbols to render with text.usetext
> turned on.
I'm seeing
--
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA
|
|
From: Paul I. <piv...@gm...> - 2008-11-25 09:28:48
|
Hey John and the rest of the MPL gang:
I've made the changes you suggested, but the problem is looking to be
deeper than it seemed. I'm also moving this conversation to
matplotlib-devel, since that's probably the more appropriate place for
it.
This updated patch allows for the creation of colormaps with various
alphas, but there is likely more work to be done so that mpl can
consistently make use of it (because it seems like all built-in cmaps
are RGB, not RGBA).
In trying to come up with an example that exercises the new
capabilities, I found out that methods like scatter and countourf modify
the colormap you give them and reset all of the alpha values to 1.
I think this is because inside collections, we pass self._alpha, which
is the Artist._alpha, and 1.0 by default, when making calls such
as:
_colors.colorConverter.to_rgba_array(c, self._alpha)
...Thus resetting all of alpha values.
I was able to get around this by allowing collections to take on an
alpha value of None, and then passing alpha=None to scatter and
countourf, for example. There are probably other places where such a
change should be done, unless someone has a better idea for how do do
this. I updated examples/pylab/plot_scatter.py to show off the new
capability.
Another thing that I was unable to get around is that if you now make a
plot using the same colormap but omit the alpha=None parameter, or set
it to something other than None, it will reset the alpha values on the
previous plot:
figure(2)
c = scatter(theta, r, c=colors, s=area,cmap=myColormap,alpha=None)
will do the right thing, but calling scatter without alpha=None
figure(3)
d = scatter(theta, r, c=colors, s=area,cmap=myColormap)
or
d = scatter(theta, r, c=colors, s=area,cmap=myColormap, alpha=.5)
will reset all of the alpha values in myColormap to 1 or .5.
You can do c.cmap._init() to reset its original alpha values, and if you
force a redraw on figure(2) (by panning or zooming on it, for example),
it will look right again. However, if you go and fiddle with figure(3)
(pan/zoom), and come back to figure(2), panning or zooming will
cause all of the alpha values will be reset again.
I'm not sure if it would be worth it to make a copy of the colormap to
prevent this from happening. Anyone have thoughts on this?
(the full example of this is commented with FIXME: in polar_scatter.py)
best,
Paul Ivanov
John Hunter, on 2008-11-23 07:36, wrote:
> On Sun, Nov 23, 2008 at 2:01 AM, Paul Ivanov <piv...@gm...> wrote:
>> I took a stab at it, how does this look?
>>
>> I also took the liberty of adding alpha to LinearSegmentedColormap and
>> updated its docstring changing two somewhat ambiguous uses of the word
>> 'entry' with 'key' and 'value'.
>
> Hey Paul,
>
> Thanks for taking this on. I haven't tested this but I read the patch
> and have some inline comments below. Some additional comments:
>
> * the patch should include a section in the CHANGELOG and
> API_CHANGES letting people know what is different.
>
> * you should run examples/tests/backend_driver.py and make sure all
> the examples still run, checking the output of some of the mappable
> types (images, scaltter, pcolor...)
>
> * it would be nice to have an example in the examples dir which
> exercises the new capabilities.
>
> See also, in case you haven't,
> http://matplotlib.sourceforge.net/devel/coding_guide.html, which
> covers some of this in more detail.
>
> Thanks again! Comments below:
>
> Index: lib/matplotlib/colors.py
> ===================================================================
> --- lib/matplotlib/colors.py (revision 6431)
> +++ lib/matplotlib/colors.py (working copy)
> @@ -452,7 +452,7 @@
> self._isinit = False
>
>
> - def __call__(self, X, alpha=1.0, bytes=False):
> + def __call__(self, X, alpha=None, bytes=False):
> """
> *X* is either a scalar or an array (of any dimension).
> If scalar, a tuple of rgba values is returned, otherwise
> @@ -466,9 +466,10 @@
> """
> You need to document what alpha can be here: what does None mean, can
> it be an array, scalar, etc...
>
> if not self._isinit: self._init()
> - alpha = min(alpha, 1.0) # alpha must be between 0 and 1
> - alpha = max(alpha, 0.0)
> - self._lut[:-3, -1] = alpha
> + if alpha:
>
> I prefer to explicitly use "if alpha is None", since there are other
> things that would test False (0, [], '') that you probably don't mean.
>
> + alpha = min(alpha, 1.0) # alpha must be between 0 and 1
> + alpha = max(alpha, 0.0)
>
> You should be able to use np.clip(alpha, 0, 1) here, but we should
> consider instead raising for illegal alpha values since this will be
> more helpful to the user. I realize some of this is inherited code
> from before your changes, but we can improve it while making this
> patch.
>
> + self._lut[:-3, -1] = alpha
> mask_bad = None
> if not cbook.iterable(X):
> vtype = 'scalar'
> @@ -558,9 +559,10 @@
> def __init__(self, name, segmentdata, N=256):
> """Create color map from linear mapping segments
>
> - segmentdata argument is a dictionary with a red, green and blue
> - entries. Each entry should be a list of *x*, *y0*, *y1* tuples,
> - forming rows in a table.
> + segmentdata argument is a dictionary with red, green and blue
> + keys. An optional alpha key is also supported. Each value
> + should be a list of *x*, *y0*, *y1* tuples, forming rows in a
> + table.
>
> Example: suppose you want red to increase from 0 to 1 over
> the bottom half, green to do the same over the middle half,
> @@ -606,6 +608,8 @@
> self._lut[:-3, 0] = makeMappingArray(self.N,
> self._segmentdata['red'])
> self._lut[:-3, 1] = makeMappingArray(self.N,
> self._segmentdata['green'])
> self._lut[:-3, 2] = makeMappingArray(self.N,
> self._segmentdata['blue'])
> + if self._segmentdata.has_key('alpha'):
> + self._lut[:-3, 3] = makeMappingArray(self.N,
> self._segmentdata['blue'])
>
> Is this what you meant? I think you would use 'alpha' rather than
> 'blue' here, no?
>
> self._isinit = True
> self._set_extremes()
>
> @@ -664,11 +668,10 @@
>
>
> def _init(self):
> - rgb = np.array([colorConverter.to_rgb(c)
> + rgba = np.array([colorConverter.to_rgba(c)
> for c in self.colors], np.float)
> self._lut = np.zeros((self.N + 3, 4), np.float)
> - self._lut[:-3, :-1] = rgb
> - self._lut[:-3, -1] = 1
> + self._lut[:-3] = rgba
> self._isinit = True
> self._set_extremes()
|
|
From: Cohen-Tanugi J. <Joh...@lp...> - 2008-11-25 09:23:16
|
indeed it works with python now, provided I uncomment the wxAgg setting
in the script.
best,
Johann
Eric Bruning wrote:
> Strange, strange. iPython is apparently having some effect here: I tried
> ipython -pylab animation.py
> and I got a figure with the initial plot, but nothing further
> happened. After closing the plot, I typed
> run animation.py
> at the ipython prompt, and saw the initial plot, erasure, and
> animation that I expected. Can you try running with a plain
> python animation.py
>
> I've attached a new version of the script with some changes suggested
> offline by Ryan May - he was seeing platform or wx-specific behavior
> related to event handling. All bugs remaining are mine :)
>
> -Eric
>
> On Sun, Nov 23, 2008 at 6:20 PM, Cohen-Tanugi Johann
> <co...@lp...> wrote:
>
>>> hi, I tried your script, commenting/uncommenting the backend line, but I
>>> still get:
>>> [cohen@jarrett ~]$ ipython -pylab MACROS/animation.py
>>>
>>> ---------------------------------------------------------------------------
>>> AttributeError Traceback (most recent call
>>> last)
>>>
>>> /home/cohen/MACROS/animation.py in <module>()
>>> 274 p.show()
>>> 275
>>> --> 276 t = test()
>>> 277
>>> 278
>>>
>>> /home/cohen/MACROS/animation.py in __init__(self)
>>> 270
>>> 271 # cid = p.gcf().canvas.mpl_connect('idle_event',
>>> self.update)
>>> --> 272 wx.GetApp().Bind(wx.EVT_IDLE, self.update)
>>> 273
>>> 274 p.show()
>>>
>>> AttributeError: 'NoneType' object has no attribute 'Bind'
>>> WARNING: Failure executing file: <MACROS/animation.py>
>>>
>>> I am using MPL revision 6440.
>>> cheers,
>>> Johann
>>>
>>> Eric Bruning wrote:
>>>
>>>> Hi Eric,
>>>>
>>>>
>>>>> On Fri, Nov 21, 2008 at 11:19 AM, Eric Jonas <jo...@mi...> wrote:
>>>>>
>>>>>
>>>>>> I've looked through the latest examples as well as google and the list
>>>>>> archives, and am still at a loss -- can anyone point me to an example
>>>>>> of
>>>>>> how to animate a scatter plot?
>>>>>>
>>>>>>
>>>> I've attached a somewhat unpolished but functional example that shows
>>>> time-synchronized animation of multiple scatter plots. It uses the wx
>>>> backend explicitly, due to some issues with the idle event handling.
>>>>
>>>>
>>>>
>>>>>> The collection returned by scatter() lacks anything akin to a set_data
>>>>>> method.
>>>>>>
>>>>>>
>>>> Yup, you want this instead:
>>>> collection.set_offsets(xy)
>>>> collection.set_array(s)
>>>>
>>>> -Eric
>>>> ------------------------------------------------------------------------
>>>>
>>>> -------------------------------------------------------------------------
>>>> This SF.Net email is sponsored by the Moblin Your Move Developer's
>>>> challenge
>>>> Build the coolest Linux based applications with Moblin SDK & win great
>>>> prizes
>>>> Grand prize is a trip for two to an Open Source event anywhere in the
>>>> world
>>>> http://moblin-contest.org/redirect.php?banner_id=100&url=/
>>>> ------------------------------------------------------------------------
>>>>
>>>> _______________________________________________
>>>> Matplotlib-users mailing list
>>>> Mat...@li...
>>>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>>>
|
|
From: Zane S. <za...@id...> - 2008-11-25 04:52:49
|
> We have two modes to render latex -- one is native TeX layout and uses
> latex and dvipng, and is superior if you need all of TeX's
> capabilities (eg an eqnarray), but the fonts are suboptimal. The
> other is mathtext, which will cover 98% of most users' math needs,
> does not require a latex install because it is pure mpl, and uses
> nicer fonts .
Well, if I turn off usetex, then the LaTeX symbols don't get rendered
correctly. It's obviously trying to do something other than just
write out the plain text, but it's not doing the right thing. I quit
out of matplotlib, and re-purged all the cached stuff from
my .matplotlib directory, and it's still failing. From the docs, it
sounds like mathtext is just the default way for Text objects to get
rendered. It fails the same way irrespective of whether I use a raw
string, or a double-quoted string:
fit_ax.set_ylabel(r'$\delta_{rms}$ [degrees]')
fit_ax.set_ylabel("$\delta_{rms}$ [degrees]")
both give a capital 'C' with a subscript 'rms'
$\bar{D}$ results in a capital D with a little circle over it.
$20^\circ$ yields 20 raised to the little tiny 'e' power.
Even if I wipe my site-packages/matplotlib* directory and egg-info,
make clean, and recompile and install matplotlib from the SVN source,
I still get the same problem. I don't know if it means anything, but
I note that the mpl-data/fonts directory in SVN has 282 sub-entries,
and the mpl-data/fonts directory that's getting installed in my site-
packages only has 99 sub-entries. But maybe they aren't supposed to
be the same? Dunno.
So for now I can only get my math symbols to render with text.usetext
turned on.
I'll read up on the text formatters. Thanks for all your help!
Zane
--
Zane Selvans
Amateur Earthling
za...@id...
303/815-6866
http://zaneselvans.org
PGP Key: 55E0815F
|
|
From: John H. <jd...@gm...> - 2008-11-25 04:10:59
|
On Mon, Nov 24, 2008 at 8:37 PM, Zane Selvans <za...@id...> wrote: > > On Nov 24, 2008, at 5:23 PM, John Hunter wrote: > > The first thing I noticed is that all of the LaTeX symbols I have in my > > plots are now messed up. I could see this being a font issue... does anyone > > I suggest completely wiping your .matplotlib directory (saving only > > your matplotlibrc if you have customized it). matplotlib caches a > > Thanks, this fixed it! > Though, futzing with the LaTeX settings in the new matplotlibrc it appears > that something about how/when it chooses when to format as tex has changed. > If text.usetex is True, text in my labels and titles that is enclosed > within $$'s gets typeset as tex, but apparently *all* of the xtick labels > get set as mathtext - they're in the light/thin and slightly more difficult > to read LaTeX font, and in my Basemap figures, the NSEW modifiers on the > text objects indicating lat/lon direction are all italicised, as they would > be were they enclosed in $$'s. I don't seem to be able to get the > relatively bold, sans-serif tick labels, while still preserving the ability > to typeset math in my labels and titles... We have two modes to render latex -- one is native TeX layout and uses latex and dvipng, and is superior if you need all of TeX's capabilities (eg an eqnarray), but the fonts are suboptimal. The other is mathtext, which will cover 98% of most users' math needs, does not require a latex install because it is pure mpl, and uses nicer fonts . The docs are here: mathtext: http://matplotlib.sourceforge.net/users/mathtext.html usetex: http://matplotlib.sourceforge.net/users/usetex.html I strongly encourage using mathtext over usetex, unless you need some of the hairy stuff from TeX. > (An aside: how does one go about decorating the Text objects that label the > ticks? I frequently have an axis whose units are degrees, and I'd rather > just be able to append a $^\circ$ on the end of the text for the ticks, > rather than have to say in the axis label [degrees].) Use a custom formatter. I'm freestyling here, so check the examples linked to below import matplotlib.ticker as ticker formatter = ticker.FormatStrFormatter(r'$%1.2f^\circ$') ax.xaxis.set_major_formatter(formatter) The API docs for the tick formatting and locating are here http://matplotlib.sourceforge.net/api/ticker_api.html And code examples matching "formatter" are here http://matplotlib.sourceforge.net/search.html?q=codex+formatter > If I set text.markup to 'tex', instead of 'plain' I get a complaint about it > being invalid, with a pointer to a URL that no longer exists to obtain a new > matplotlibrc: > Bad key "text.markup" on line 162 in /Users/zane/.matplotlib/matplotlibrc. > You probably need to get an updated matplotlibrc file > from http://matplotlib.sf.net/matplotlibrc or from the matplotlib > source distribution I've updated the code in svn to point to the new location http://matplotlib.sourceforge.net/_static/matplotlibrc See also http://matplotlib.sourceforge.net/users/customizing.html JDH |
|
From: Zane S. <za...@id...> - 2008-11-25 02:38:14
|
On Nov 24, 2008, at 5:23 PM, John Hunter wrote: >> The first thing I noticed is that all of the LaTeX symbols I have >> in my >> plots are now messed up. I could see this being a font issue... >> does anyone > I suggest completely wiping your .matplotlib directory (saving only > your matplotlibrc if you have customized it). matplotlib caches a Thanks, this fixed it! Though, futzing with the LaTeX settings in the new matplotlibrc it appears that something about how/when it chooses when to format as tex has changed. If text.usetex is True, text in my labels and titles that is enclosed within $$'s gets typeset as tex, but apparently *all* of the xtick labels get set as mathtext - they're in the light/thin and slightly more difficult to read LaTeX font, and in my Basemap figures, the NSEW modifiers on the text objects indicating lat/lon direction are all italicised, as they would be were they enclosed in $ $'s. I don't seem to be able to get the relatively bold, sans-serif tick labels, while still preserving the ability to typeset math in my labels and titles... (An aside: how does one go about decorating the Text objects that label the ticks? I frequently have an axis whose units are degrees, and I'd rather just be able to append a $^\circ$ on the end of the text for the ticks, rather than have to say in the axis label [degrees].) If I set text.markup to 'tex', instead of 'plain' I get a complaint about it being invalid, with a pointer to a URL that no longer exists to obtain a new matplotlibrc: Bad key "text.markup" on line 162 in /Users/zane/.matplotlib/ matplotlibrc. You probably need to get an updated matplotlibrc file from http://matplotlib.sf.net/matplotlibrc or from the matplotlib source distribution Thanks again! Zane -- Zane Selvans Amateur Earthling za...@id... 303/815-6866 http://zaneselvans.org PGP Key: 55E0815F |
|
From: Eric B. <eri...@gm...> - 2008-11-25 01:44:28
|
Strange, strange. iPython is apparently having some effect here: I tried
ipython -pylab animation.py
and I got a figure with the initial plot, but nothing further
happened. After closing the plot, I typed
run animation.py
at the ipython prompt, and saw the initial plot, erasure, and
animation that I expected. Can you try running with a plain
python animation.py
I've attached a new version of the script with some changes suggested
offline by Ryan May - he was seeing platform or wx-specific behavior
related to event handling. All bugs remaining are mine :)
-Eric
On Sun, Nov 23, 2008 at 6:20 PM, Cohen-Tanugi Johann
<co...@lp...> wrote:
>
>> hi, I tried your script, commenting/uncommenting the backend line, but I
>> still get:
>> [cohen@jarrett ~]$ ipython -pylab MACROS/animation.py
>>
>> ---------------------------------------------------------------------------
>> AttributeError Traceback (most recent call
>> last)
>>
>> /home/cohen/MACROS/animation.py in <module>()
>> 274 p.show()
>> 275
>> --> 276 t = test()
>> 277
>> 278
>>
>> /home/cohen/MACROS/animation.py in __init__(self)
>> 270
>> 271 # cid = p.gcf().canvas.mpl_connect('idle_event',
>> self.update)
>> --> 272 wx.GetApp().Bind(wx.EVT_IDLE, self.update)
>> 273
>> 274 p.show()
>>
>> AttributeError: 'NoneType' object has no attribute 'Bind'
>> WARNING: Failure executing file: <MACROS/animation.py>
>>
>> I am using MPL revision 6440.
>> cheers,
>> Johann
>>
>> Eric Bruning wrote:
>>>
>>> Hi Eric,
>>>
>>>>
>>>> On Fri, Nov 21, 2008 at 11:19 AM, Eric Jonas <jo...@mi...> wrote:
>>>>
>>>>>
>>>>> I've looked through the latest examples as well as google and the list
>>>>> archives, and am still at a loss -- can anyone point me to an example
>>>>> of
>>>>> how to animate a scatter plot?
>>>>>
>>>
>>> I've attached a somewhat unpolished but functional example that shows
>>> time-synchronized animation of multiple scatter plots. It uses the wx
>>> backend explicitly, due to some issues with the idle event handling.
>>>
>>>
>>>>>
>>>>> The collection returned by scatter() lacks anything akin to a set_data
>>>>> method.
>>>>>
>>>
>>> Yup, you want this instead:
>>> collection.set_offsets(xy)
>>> collection.set_array(s)
>>>
>>> -Eric
>>> ------------------------------------------------------------------------
>>>
>>> -------------------------------------------------------------------------
>>> This SF.Net email is sponsored by the Moblin Your Move Developer's
>>> challenge
>>> Build the coolest Linux based applications with Moblin SDK & win great
>>> prizes
>>> Grand prize is a trip for two to an Open Source event anywhere in the
>>> world
>>> http://moblin-contest.org/redirect.php?banner_id=100&url=/
>>> ------------------------------------------------------------------------
>>>
>>> _______________________________________________
>>> Matplotlib-users mailing list
>>> Mat...@li...
>>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>
>
|
|
From: John H. <jd...@gm...> - 2008-11-25 01:23:50
|
On Mon, Nov 24, 2008 at 6:23 PM, Zane Selvans <za...@id...> wrote:
> whether it's just the fact that I'm using the SVN code.
> The first thing I noticed is that all of the LaTeX symbols I have in my
> plots are now messed up. I could see this being a font issue... does anyone
> know how/where Matplotlib gets pointed at the LaTeX fonts? And how I would
> check to see where it's looking, or whether it's not finding what it's
> looking for? I'm not getting any errors - my greek letters just cease to be
> greek, and various text decorations (like \bar{D}) come out as other things
> altogether (like D, only with an Angstrom symbol over it...).
I suggest completely wiping your .matplotlib directory (saving only
your matplotlibrc if you have customized it). matplotlib caches a
fair amount of font and latex rendering stuff. I had a similar
problem on an upgrade with mathtext. We are not sure why it is
happening yet, but it will probably go away if you rm -rf
~/.matplotlib. Also, wipe your site-packages/matplotlib dir before
installing. See
http://matplotlib.sourceforge.net/faq/installing_faq.html#cleanly-rebuild-and-reinstall-everything
To get more verbose information about what mpl is doing behind the
scense, run with
> python myscript.py --verbose-debug
You can use --verbose-helpful for less output.
I think it might be a good idea for us to start using a versioned dir
structure for the cached data...
JDH
|
|
From: Eric F. <ef...@ha...> - 2008-11-25 00:48:13
|
Zane Selvans wrote: > Yesterday I compiled Matplotlib from SVN, and installed it to run on top [...] > > The second thing is that in a figure in which I'm using twinx() to > create a separate y-axis using the same x-axis, I no longer seem to be > able to control the limits of the new axes. They just automatically > re-scale to fit whatever data is being plotted, regardless of whether I > use ax.set_ylim(). Formerly, autoscaling was not supported by shared axes, which would have included twinx. Now autoscaling is supported. I suspect this is the difference you are seeing. The solution is to turn off autoscaling with the ax.set_autoscale_on method, or to call ax.set_ylim after you have plotted your lines. Eric |
|
From: Zane S. <za...@id...> - 2008-11-25 00:24:11
|
Yesterday I compiled Matplotlib from SVN, and installed it to run on
top of the dependencies that I have installed from the SciPy Superpack
for OS X from Chris Fonnesbeck. Nearly everything seems to be working
fine. However, there are a couple of glitches, and I can't tell
whether it's because of something being out of sync between all my
installed bits, or whether it's just the fact that I'm using the SVN
code.
The first thing I noticed is that all of the LaTeX symbols I have in
my plots are now messed up. I could see this being a font issue...
does anyone know how/where Matplotlib gets pointed at the LaTeX
fonts? And how I would check to see where it's looking, or whether
it's not finding what it's looking for? I'm not getting any errors -
my greek letters just cease to be greek, and various text decorations
(like \bar{D}) come out as other things altogether (like D, only with
an Angstrom symbol over it...).
The second thing is that in a figure in which I'm using twinx() to
create a separate y-axis using the same x-axis, I no longer seem to be
able to control the limits of the new axes. They just automatically
re-scale to fit whatever data is being plotted, regardless of whether
I use ax.set_ylim().
Third, and this was a problem before I did the re-compile, and it
remains so, often (but not always) my figures refuse to draw
completely, until I've re-sized the window in which they're being
displayed. This happens even when I do a figure.show() at the end of
the script. Some of the lines will draw, but not all of them. Is
this a familiar problem?
Thanks for any suggestions...
Zane
--
Zane Selvans
Amateur Earthling
za...@id...
303/815-6866
http://zaneselvans.org
PGP Key: 55E0815F
|