SourceForge logo
SourceForge logo
Menu

matplotlib-users — Discussion related to using matplotlib

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
(38)
2
(31)
3
(9)
4
(13)
5
(24)
6
(11)
7
(8)
8
(14)
9
(7)
10
(4)
11
(7)
12
(11)
13
(16)
14
(19)
15
(11)
16
(9)
17
(3)
18
(4)
19
(47)
20
(28)
21
(9)
22
(9)
23
(11)
24
25
26
(12)
27
(22)
28
(20)
29
(16)
30
(19)

Showing results of 46

1 2 > >> (Page 1 of 2)
From: Ryan M. <rm...@gm...> - 2010年04月19日 23:30:20
On Mon, Apr 19, 2010 at 5:29 PM, Mathew Yeates <mat...@gm...> wrote:
> Will this work for multiple figures?
>
Yes, with the caveat that the data ranges are synced, so if you're
doing something like set_aspect('equal', 'datalims'), all the plots
must have the same aspect ratio as well.
Ryan
-- 
Ryan May
Graduate Research Assistant
School of Meteorology
University of Oklahoma
From: Mathew Y. <mat...@gm...> - 2010年04月19日 22:29:56
Will this work for multiple figures?
On 4/19/10, Ryan May <rm...@gm...> wrote:
> On Mon, Apr 19, 2010 at 4:55 PM, Mathew Yeates <mat...@gm...> wrote:
>> Hi
>> I want to have a single Navigation Toolbar that lets me do things like
>> ...... Zoom to rect in one figure and see this change in all figures.
>> Anybody think this can be done? Any thoughts?
>
> You can have the plots share axes, look here:
>
> http://matplotlib.sourceforge.net/examples/pylab_examples/shared_axis_demo.html
>
> Ryan
>
> --
> Ryan May
> Graduate Research Assistant
> School of Meteorology
> University of Oklahoma
>
From: Ryan M. <rm...@gm...> - 2010年04月19日 22:03:31
On Mon, Apr 19, 2010 at 4:55 PM, Mathew Yeates <mat...@gm...> wrote:
> Hi
> I want to have a single Navigation Toolbar that lets me do things like
> ...... Zoom to rect in one figure and see this change in all figures.
> Anybody think this can be done? Any thoughts?
You can have the plots share axes, look here:
http://matplotlib.sourceforge.net/examples/pylab_examples/shared_axis_demo.html
Ryan
-- 
Ryan May
Graduate Research Assistant
School of Meteorology
University of Oklahoma
From: Mathew Y. <mat...@gm...> - 2010年04月19日 21:55:43
Hi
I want to have a single Navigation Toolbar that lets me do things like
 ...... Zoom to rect in one figure and see this change in all figures.
Anybody think this can be done? Any thoughts?
Mathew
From: william r. <wil...@gm...> - 2010年04月19日 21:55:34
Progress:
c:\python25\lib\site-packages\matplotlib\mathtext.py:848: MathTextWarning:
Font 'rm' does not have a glyph for '\perp'
 MathTextWarning)
c:\python25\lib\site-packages\matplotlib\mathtext.py:849: MathTextWarning:
Substituting with a dummy symbol.
 warn("Substituting with a dummy symbol.", MathTextWarning)
----
Next, I followed your suggestion and deleted the fontlist.cache file and
that solved everything. Thanks!!!
So, that's where the dummy symbol is coming from.
On Mon, Apr 19, 2010 at 3:42 PM, Michael Droettboom <md...@st...> wrote:
> Hmm... I'm a bit stumped. Can you print out the values of these from your
> script, i.e. put the following at the top:
>
> from matplotlib import rcParams
> print rcParams['mathtext.fontset']
> print rcParams['mathtext.default']
>
> Can you try deleting your fontList.cache file?
>
> Mike
>
>
> william ratcliff wrote:
>
>> From my mpl-data directory, here's what's in the mathtext section of my
>> matplotlibrc file:
>> # The following settings allow you to select the fonts in math mode.
>> # They map from a TeX font name to a fontconfig font pattern.
>> # These settings are only used if mathtext.fontset is 'custom'.
>> # Note that this "custom" mode is unsupported and may go away in the
>> # future.
>> #mathtext.cal : cursive
>> #mathtext.rm : serif
>> #mathtext.tt : monospace
>> #mathtext.it : serif:italic
>> #mathtext.bf : serif:bold
>> #mathtext.sf : sans
>> #mathtext.fontset : cm # Should be 'cm' (Computer Modern), 'stix',
>> # 'stixsans' or 'custom'
>> mathtext.fallback_to_cm : True # When True, use symbols from the Computer
>> Modern
>> # fonts when a symbol can not be found in one of
>> # the custom math fonts.
>>
>> #mathtext.default : it # The default font to use for math.
>> # Can be any of the LaTeX font names, including
>> # the special name "regular" for the same font
>>
>>
>> On Mon, Apr 19, 2010 at 2:40 PM, Michael Droettboom <md...@st...>
>> wrote:
>>
>>
>>
>>> The puzzling thing is this:
>>>
>>>
>>> u'C:\\WINDOWS\\Fonts\\HTOWERTI.TTF'
>>>
>>> It's using a custom font in mathtext. Are you setting the rcParams
>>> mathtext.fontset or mathtext.default? That may the culprit, and if not,
>>> it's a bug that it's trying to use that font.
>>>
>>>
>>> Mike
>>>
>>> william ratcliff wrote:
>>>
>>>
>>>
>>>> On the plus side, there is no longer an error when I apply the patch.
>>>> On
>>>> the downside, it generates a rather strange symbol instead of a
>>>> perpendicular symbol....Let me try to quickly upgrade to 0.99.1. I did
>>>> that
>>>> and I seem to get the same error...
>>>>
>>>> On Mon, Apr 19, 2010 at 10:49 AM, Michael Droettboom <md...@st...
>>>>
>>>>
>>>>> wrote:
>>>>>
>>>>>
>>>>
>>>>
>>>>
>>>>> Does forcibly casting the path to a string resolve the problem? i.e.
>>>>> applying this patch:
>>>>>
>>>>> Index: mathtext.py
>>>>> ===================================================================
>>>>> --- mathtext.py (revision 8216)
>>>>> +++ mathtext.py (working copy)
>>>>> @@ -597,7 +597,7 @@
>>>>>
>>>>> cached_font = self._fonts.get(basename)
>>>>> if cached_font is None:
>>>>> - font = FT2Font(basename)
>>>>> + font = FT2Font(str(basename))
>>>>> cached_font = self.CachedFont(font)
>>>>> self._fonts[basename] = cached_font
>>>>> self._fonts[font.postscript_name] = cached_font
>>>>>
>>>>> Mike
>>>>>
>>>>> william ratcliff wrote:
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>> Mike,
>>>>>>
>>>>>> The basename is:
>>>>>> u'C:\\WINDOWS\\Fonts\\HTOWERTI.TTF'
>>>>>>
>>>>>> Let me try to find where my matplotlibrc file is located...
>>>>>>
>>>>>> Thanks,
>>>>>> William
>>>>>>
>>>>>> On Mon, Apr 19, 2010 at 10:22 AM, Michael Droettboom <md...@st...
>>>>>> <mailto:
>>>>>> md...@st...>> wrote:
>>>>>>
>>>>>> One might see that error if the path to the font being used
>>>>>> contains non-ascii characters (the "basename" variable in the last
>>>>>> frame of the stack in the stacktrace). Is that possible? We may
>>>>>> need to implement the same workaround we use for image files for
>>>>>> loading fonts (which is to open the file with Python and pass a
>>>>>> file handle to C++ rather than passing a string that may contain
>>>>>> Unicode, which is difficult to handle in cross-platform way from
>>>>>> C/C++).
>>>>>>
>>>>>> Mike
>>>>>>
>>>>>> william ratcliff wrote:
>>>>>>
>>>>>> I think the actual error was:
>>>>>> TypeError: cannot return std::string from Unicode object
>>>>>>
>>>>>> It was the error returned when I walked through with a
>>>>>> debugger...
>>>>>>
>>>>>> On Mon, Apr 19, 2010 at 8:51 AM, Michael Droettboom
>>>>>> <md...@st... <mailto:md...@st...>
>>>>>> <mailto:md...@st... <mailto:md...@st...>>> wrote:
>>>>>>
>>>>>> It looks like the end of the traceback -- where the actual
>>>>>> exception is named -- is missing. Can you repost it in its
>>>>>> entirety?
>>>>>>
>>>>>> Mike
>>>>>>
>>>>>> william ratcliff wrote:
>>>>>>
>>>>>> Hi! I am using matplotlib 0.99.0 under windows xp. I
>>>>>> tried
>>>>>> the following:
>>>>>> ax.text(.96,.80,r'$P \perp
>>>>>>
>>>>>>
>>>>>>
>>>>>> Q$',fontsize=18,horizontalalignment='right',verticalalignment='top',transform=ax.transAxes,color='black')
>>>>>> and get the following error:
>>>>>> (However, in figure labels, symbols using mathtext, such
>>>>>> as
>>>>>> theta seem to work fine...)
>>>>>>
>>>>>> Thanks,
>>>>>> William
>>>>>>
>>>>>> TypeError: cannot return std::string from Unicode object
>>>>>> File
>>>>>>
>>>>>>
>>>>>> "C:\mytripleaxisproject\trunk\eclipse\src\utilities\bfo_film_fig2.py",
>>>>>> line 301, in <module>
>>>>>> film110()
>>>>>> File
>>>>>>
>>>>>>
>>>>>> "C:\mytripleaxisproject\trunk\eclipse\src\utilities\bfo_film_fig2.py",
>>>>>> line 157, in film110
>>>>>> plt.show()
>>>>>> File
>>>>>>
>>>>>> "C:\Python25\Lib\site-packages\matplotlib\backends\backend_qt4.py",
>>>>>> line 63, in show
>>>>>> manager.window.show()
>>>>>> File
>>>>>>
>>>>>> "C:\Python25\Lib\site-packages\matplotlib\backends\backend_qt4.py",
>>>>>> line 168, in resizeEvent
>>>>>> self.draw()
>>>>>> File
>>>>>>
>>>>>>
>>>>>> "C:\Python25\Lib\site-packages\matplotlib\backends\backend_qt4agg.py",
>>>>>> line 130, in draw
>>>>>> FigureCanvasAgg.draw(self)
>>>>>> File
>>>>>>
>>>>>> "C:\Python25\Lib\site-packages\matplotlib\backends\backend_agg.py",
>>>>>> line 314, in draw
>>>>>> self.figure.draw(self.renderer)
>>>>>> File "C:\Python25\Lib\site-packages\matplotlib\artist.py",
>>>>>> line 46, in draw_wrapper
>>>>>> draw(artist, renderer, *kl)
>>>>>> File "C:\Python25\Lib\site-packages\matplotlib\figure.py",
>>>>>> line 774, in draw
>>>>>> for a in self.axes: a.draw(renderer)
>>>>>> File "C:\Python25\Lib\site-packages\matplotlib\artist.py",
>>>>>> line 46, in draw_wrapper
>>>>>> draw(artist, renderer, *kl)
>>>>>> File
>>>>>> "C:\Python25\Lib\site-packages\matplotlib\axes.py", line
>>>>>> 1721, in draw
>>>>>> a.draw(renderer)
>>>>>> File
>>>>>> "C:\Python25\Lib\site-packages\matplotlib\text.py", line
>>>>>> 515, in draw
>>>>>> bbox, info = self._get_layout(renderer)
>>>>>> File
>>>>>> "C:\Python25\Lib\site-packages\matplotlib\text.py", line
>>>>>> 279, in _get_layout
>>>>>> clean_line, self._fontproperties, ismath=ismath)
>>>>>> File
>>>>>>
>>>>>> "C:\Python25\Lib\site-packages\matplotlib\backends\backend_agg.py",
>>>>>> line 156, in get_text_width_height_descent
>>>>>> self.mathtext_parser.parse(s, self.dpi, prop)
>>>>>> File
>>>>>> "C:\Python25\Lib\site-packages\matplotlib\mathtext.py",
>>>>>> line 2810, in parse
>>>>>> box = self._parser.parse(s, font_output, fontsize, dpi)
>>>>>> File
>>>>>> "C:\Python25\Lib\site-packages\matplotlib\mathtext.py",
>>>>>> line 2259, in parse
>>>>>> self._expression.parseString(s)
>>>>>> File
>>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>>> line 1048, in parseString
>>>>>> loc, tokens = self._parse( instring, 0 )
>>>>>> File
>>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>>> line 981, in _parseCache
>>>>>> value = self._parseNoCache( instring, loc, doActions,
>>>>>> callPreParse )
>>>>>> File
>>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>>> line 924, in _parseNoCache
>>>>>> loc,tokens = self.parseImpl( instring, preloc, doActions
>>>>>> )
>>>>>> File
>>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>>> line 2559, in parseImpl
>>>>>> return self.expr._parse( instring, loc, doActions,
>>>>>> callPreParse=False )
>>>>>> File
>>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>>> line 981, in _parseCache
>>>>>> value = self._parseNoCache( instring, loc, doActions,
>>>>>> callPreParse )
>>>>>> File
>>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>>> line 924, in _parseNoCache
>>>>>> loc,tokens = self.parseImpl( instring, preloc, doActions
>>>>>> )
>>>>>> File
>>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>>> line 2307, in parseImpl
>>>>>> loc, exprtokens = e._parse( instring, loc, doActions )
>>>>>> File
>>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>>> line 981, in _parseCache
>>>>>> value = self._parseNoCache( instring, loc, doActions,
>>>>>> callPreParse )
>>>>>> File
>>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>>> line 924, in _parseNoCache
>>>>>> loc,tokens = self.parseImpl( instring, preloc, doActions
>>>>>> )
>>>>>> File
>>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>>> line 2672, in parseImpl
>>>>>> loc, tokens = self.expr._parse( instring, loc, doActions,
>>>>>> callPreParse=False )
>>>>>> File
>>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>>> line 981, in _parseCache
>>>>>> value = self._parseNoCache( instring, loc, doActions,
>>>>>> callPreParse )
>>>>>> File
>>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>>> line 924, in _parseNoCache
>>>>>> loc,tokens = self.parseImpl( instring, preloc, doActions
>>>>>> )
>>>>>> File
>>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>>> line 2307, in parseImpl
>>>>>> loc, exprtokens = e._parse( instring, loc, doActions )
>>>>>> File
>>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>>> line 981, in _parseCache
>>>>>> value = self._parseNoCache( instring, loc, doActions,
>>>>>> callPreParse )
>>>>>> File
>>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>>> line 924, in _parseNoCache
>>>>>> loc,tokens = self.parseImpl( instring, preloc, doActions
>>>>>> )
>>>>>> File
>>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>>> line 2756, in parseImpl
>>>>>> loc, tokens = self.expr._parse( instring, loc, doActions,
>>>>>> callPreParse=False )
>>>>>> File
>>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>>> line 981, in _parseCache
>>>>>> value = self._parseNoCache( instring, loc, doActions,
>>>>>> callPreParse )
>>>>>> File
>>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>>> line 924, in _parseNoCache
>>>>>> loc,tokens = self.parseImpl( instring, preloc, doActions
>>>>>> )
>>>>>> File
>>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>>> line 2714, in parseImpl
>>>>>> loc, tmptokens = self.expr._parse( instring, preloc,
>>>>>> doActions )
>>>>>> File
>>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>>> line 981, in _parseCache
>>>>>> value = self._parseNoCache( instring, loc, doActions,
>>>>>> callPreParse )
>>>>>> File
>>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>>> line 924, in _parseNoCache
>>>>>> loc,tokens = self.parseImpl( instring, preloc, doActions
>>>>>> )
>>>>>> File
>>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>>> line 2373, in parseImpl
>>>>>> return maxMatchExp._parse( instring, loc, doActions )
>>>>>> File
>>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>>> line 981, in _parseCache
>>>>>> value = self._parseNoCache( instring, loc, doActions,
>>>>>> callPreParse )
>>>>>> File
>>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>>> line 924, in _parseNoCache
>>>>>> loc,tokens = self.parseImpl( instring, preloc, doActions
>>>>>> )
>>>>>> File
>>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>>> line 2559, in parseImpl
>>>>>> return self.expr._parse( instring, loc, doActions,
>>>>>> callPreParse=False )
>>>>>> File
>>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>>> line 981, in _parseCache
>>>>>> value = self._parseNoCache( instring, loc, doActions,
>>>>>> callPreParse )
>>>>>> File
>>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>>> line 924, in _parseNoCache
>>>>>> loc,tokens = self.parseImpl( instring, preloc, doActions
>>>>>> )
>>>>>> File
>>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>>> line 2416, in parseImpl
>>>>>> ret = e._parse( instring, loc, doActions )
>>>>>> File
>>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>>> line 981, in _parseCache
>>>>>> value = self._parseNoCache( instring, loc, doActions,
>>>>>> callPreParse )
>>>>>> File
>>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>>> line 924, in _parseNoCache
>>>>>> loc,tokens = self.parseImpl( instring, preloc, doActions
>>>>>> )
>>>>>> File
>>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>>> line 2559, in parseImpl
>>>>>> return self.expr._parse( instring, loc, doActions,
>>>>>> callPreParse=False )
>>>>>> File
>>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>>> line 981, in _parseCache
>>>>>> value = self._parseNoCache( instring, loc, doActions,
>>>>>> callPreParse )
>>>>>> File
>>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>>> line 924, in _parseNoCache
>>>>>> loc,tokens = self.parseImpl( instring, preloc, doActions
>>>>>> )
>>>>>> File
>>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>>> line 2559, in parseImpl
>>>>>> return self.expr._parse( instring, loc, doActions,
>>>>>> callPreParse=False )
>>>>>> File
>>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>>> line 981, in _parseCache
>>>>>> value = self._parseNoCache( instring, loc, doActions,
>>>>>> callPreParse )
>>>>>> File
>>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>>> line 924, in _parseNoCache
>>>>>> loc,tokens = self.parseImpl( instring, preloc, doActions
>>>>>> )
>>>>>> File
>>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>>> line 2416, in parseImpl
>>>>>> ret = e._parse( instring, loc, doActions )
>>>>>> File
>>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>>> line 981, in _parseCache
>>>>>> value = self._parseNoCache( instring, loc, doActions,
>>>>>> callPreParse )
>>>>>> File
>>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>>> line 924, in _parseNoCache
>>>>>> loc,tokens = self.parseImpl( instring, preloc, doActions
>>>>>> )
>>>>>> File
>>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>>> line 2293, in parseImpl
>>>>>> loc, resultlist = self.exprs[0]._parse( instring, loc,
>>>>>> doActions, callPreParse=False )
>>>>>> File
>>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>>> line 981, in _parseCache
>>>>>> value = self._parseNoCache( instring, loc, doActions,
>>>>>> callPreParse )
>>>>>> File
>>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>>> line 924, in _parseNoCache
>>>>>> loc,tokens = self.parseImpl( instring, preloc, doActions
>>>>>> )
>>>>>> File
>>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>>> line 2756, in parseImpl
>>>>>> loc, tokens = self.expr._parse( instring, loc, doActions,
>>>>>> callPreParse=False )
>>>>>> File
>>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>>> line 981, in _parseCache
>>>>>> value = self._parseNoCache( instring, loc, doActions,
>>>>>> callPreParse )
>>>>>> File
>>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>>> line 924, in _parseNoCache
>>>>>> loc,tokens = self.parseImpl( instring, preloc, doActions
>>>>>> )
>>>>>> File
>>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>>> line 2559, in parseImpl
>>>>>> return self.expr._parse( instring, loc, doActions,
>>>>>> callPreParse=False )
>>>>>> File
>>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>>> line 981, in _parseCache
>>>>>> value = self._parseNoCache( instring, loc, doActions,
>>>>>> callPreParse )
>>>>>> File
>>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>>> line 924, in _parseNoCache
>>>>>> loc,tokens = self.parseImpl( instring, preloc, doActions
>>>>>> )
>>>>>> File
>>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>>> line 2373, in parseImpl
>>>>>> return maxMatchExp._parse( instring, loc, doActions )
>>>>>> File
>>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>>> line 981, in _parseCache
>>>>>> value = self._parseNoCache( instring, loc, doActions,
>>>>>> callPreParse )
>>>>>> File
>>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>>> line 924, in _parseNoCache
>>>>>> loc,tokens = self.parseImpl( instring, preloc, doActions
>>>>>> )
>>>>>> File
>>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>>> line 2416, in parseImpl
>>>>>> ret = e._parse( instring, loc, doActions )
>>>>>> File
>>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>>> line 981, in _parseCache
>>>>>> value = self._parseNoCache( instring, loc, doActions,
>>>>>> callPreParse )
>>>>>> File
>>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>>> line 950, in _parseNoCache
>>>>>> tokens = fn( instring, tokensStart, retTokens )
>>>>>> File
>>>>>> "C:\Python25\Lib\site-packages\matplotlib\mathtext.py",
>>>>>> line 2374, in symbol
>>>>>> char = Char(c, self.get_state())
>>>>>> File
>>>>>> "C:\Python25\Lib\site-packages\matplotlib\mathtext.py",
>>>>>> line 1264, in __init__
>>>>>> self._update_metrics()
>>>>>> File
>>>>>> "C:\Python25\Lib\site-packages\matplotlib\mathtext.py",
>>>>>> line 1271, in _update_metrics
>>>>>> self.font, self.font_class, self.c, self.fontsize,
>>>>>> self.dpi)
>>>>>> File
>>>>>> "C:\Python25\Lib\site-packages\matplotlib\mathtext.py",
>>>>>> line 446, in get_metrics
>>>>>> info = self._get_info(font, font_class, sym, fontsize,
>>>>>> dpi)
>>>>>> File
>>>>>> "C:\Python25\Lib\site-packages\matplotlib\mathtext.py",
>>>>>> line 579, in _get_info
>>>>>> self._get_glyph(fontname, font_class, sym, fontsize)
>>>>>> File
>>>>>> "C:\Python25\Lib\site-packages\matplotlib\mathtext.py",
>>>>>> line 697, in _get_glyph
>>>>>> fontname, font_class, sym, fontsize)
>>>>>> File
>>>>>> "C:\Python25\Lib\site-packages\matplotlib\mathtext.py",
>>>>>> line 827, in _get_glyph
>>>>>> cached_font = self._get_font(new_fontname)
>>>>>> File
>>>>>> "C:\Python25\Lib\site-packages\matplotlib\mathtext.py",
>>>>>> line 560, in _get_font
>>>>>> font = FT2Font(basename)
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> ------------------------------------------------------------------------
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> ------------------------------------------------------------------------------
>>>>>> Download Intel&#174; Parallel Studio Eval
>>>>>> Try the new software tools for yourself. Speed
>>>>>> compiling, find
>>>>>> bugs
>>>>>> proactively, and fine-tune applications for parallel
>>>>>> performance.
>>>>>> See why Intel Parallel Studio got high marks during beta.
>>>>>> http://p.sf.net/sfu/intel-sw-dev
>>>>>>
>>>>>>
>>>>>>
>>>>>> ------------------------------------------------------------------------
>>>>>>
>>>>>> _______________________________________________
>>>>>> Matplotlib-users mailing list
>>>>>> Mat...@li...
>>>>>> <mailto:Mat...@li...>
>>>>>> <mailto:Mat...@li...
>>>>>> <mailto: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
>>>>>>
>>>>>>
>>>>>>
>>>>>> -- Michael Droettboom
>>>>>> Science Software Branch
>>>>>> Operations and Engineering Division
>>>>>> Space Telescope Science Institute
>>>>>> Operated by AURA for NASA
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>> --
>>>>> Michael Droettboom
>>>>> Science Software Branch
>>>>> Operations and Engineering Division
>>>>> Space Telescope Science Institute
>>>>> Operated by AURA for NASA
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>>
>>> --
>>> Michael Droettboom
>>> Science Software Branch
>>> Operations and Engineering Division
>>> Space Telescope Science Institute
>>> Operated by AURA for NASA
>>>
>>>
>>>
>>>
>>
>>
>>
>
> --
> Michael Droettboom
> Science Software Branch
> Operations and Engineering Division
> Space Telescope Science Institute
> Operated by AURA for NASA
>
>
From: C M <cmp...@gm...> - 2010年04月19日 21:24:20
Michael and Darren (and others),
I've used svn before to download pure Python code, but never to get
anything that needed to be built. I'm fairly out to sea here, so
thanks for the patience.
> When building from source, you also need the header files (*.h files) of all
> of matplotlib's dependencies. When you install the matplotlib binary
> package (.deb file), these header files are not installed. Debian, Ubuntu
> and most other Linux distros separate the compiled binary libraries and
> header files into separate packages. The latter are usually named the same
> as the binary package but with a "-dev" suffix.
That's useful to know.
> The "apt-get build-dep" command is designed specifically to install all of
> the header files required to build a particular package. Therefore "apt-get
> build-dep python-matplotlib" is a great shortcut to set up your machine for
> building matplotlib from source.
I did that, and then did the setup.py install and, yes, it now all
works for me (not that you don't know that). I have mpl 1.0 installed
on that Ubuntu machine. (btw, Mauro, thanks for the tip on
Jaunty...I've been having random crashes with Intrepid now and may try
to start anew with Lucid Lynx when it comes out in a couple of weeks).
>> Is this need to install dependencies usually the case when installing
>> from svn?--and if so, can I suggest that this be mentioned in the
>> online documentation? (perhaps it is and I didn't see it?).
>>
>
> It sure can -- it was overlooked because this requirement is true of any
> compiled piece of software, not just matplotlib.
> Would you like to contribute a paragraph or two? I'd be happy to merge it into the docs.
I can at least try; let me know if what follows is a good approach to
take. The problem I've had today is that I didn't realize one has to
build matplotlib when getting it as source AND that there are a lot of
build requirements prior to installing. All that actually IS on a web
page, but my problem is when I skipped to the "install from svn" link,
I was then on a new page that didn't mention it, and, being new to
building, didn't realize it. And so, my suggestion would be that at
every place (1-3 places perhaps) where the docs mention doing the
following:
> cd matplotlib
> python setup.py build
> python setup.py install
(such as on the "install from svn" page) ...there can be a) a small
note reminding newbies that in order to build you need to have the
build requirements satisfied or else the build will fail with numerous
errors, and in that note b) a link back to the "Build requirements"
paragraph already on this page, here:
http://matplotlib.sourceforge.net/users/installing.html
...and maybe c) the shortcut that you mentioned for Linux users. If
(c) doesn't belong there, it should at least be in the "Build
requirements" paragraph, something along the lines of this:
"Note: if you are building matplotlib on Linux, instead of manually
installing all of the build requirements (dependencies), you can
simply run this command:
> apt-get build-dep python-matplotlib
It should take some time to finish, but you will then have built
matplotlib as well as everything needed to have it work. Afterward,
all you need do is install it with:
> cd matplotlib
> python setup.py install"
I hope this makes sense. I appreciate everyone's help here.
Che
From: Friedrich R. <fri...@gm...> - 2010年04月19日 20:00:06
2010年4月19日 Michael Droettboom <md...@st...>:
> Friedrich Romstedt wrote:
>>
>>  What is the advantage of using
>> matplotlib.ticker.ScalarFormatter(useMathText = True) then, when it's
>> typeset in outside-math font anyway?
>>
>
> It's the only way to get superscripts (well, Unicode has superscript
> numerals, but the formatter doesn't currently use them).
Understood, so for the scientific notation? I.e., for the case when
there is a \times<something> at the edge? (It's clear we're talking
about ScalarFormatter.)
I would like it very much if one could make *all* text in matplotlib
figures be set in LaTeX font, for integration with LaTeX documents the
figures are used in. Is this already possible?
Friedrich
From: Friedrich R. <fri...@gm...> - 2010年04月19日 19:45:50
2010年4月19日 Eric Firing <ef...@ha...>:
> David Ho wrote:
>> Just as an illustration, I'm looking for a nice way to plot something
>> like this:
>> http://labrosa.ee.columbia.edu/matlab/sgram/
>>
>> I don't necessarily need a weighting matrix to convert the Pxx array,
>> which is what Dan Ellis' code does; I just need to visualize the
>> spectrogram on a logarithmic axis.
>>
>> Is there any built-in way to do this?
>
> David,
>
> The components exist, but they have not been assembled. One approach
> would be to use the NonUniformImage class in place of image to handle
> the log axis case. A variation would be to use pcolorfast. Evidently
> we need to add a log scale option to the existing specgram. I can't do
> it right now--maybe someone else will.
>
> Eric
Hello David,
You asked for a builtin solution, and I think this question has been
answered by Eric, but maybe you want also a more elaborate solution.
As a workaround, do you think you can do the spectrogram
transformation on your own using the functions matplotlib uses to
generate the data, and use pcolor() to plot it with a logarithmic
mesh?
Friedrich
From: Michael D. <md...@st...> - 2010年04月19日 19:42:23
Hmm... I'm a bit stumped. Can you print out the values of these from 
your script, i.e. put the following at the top:
 from matplotlib import rcParams
 print rcParams['mathtext.fontset']
 print rcParams['mathtext.default']
Can you try deleting your fontList.cache file?
Mike
william ratcliff wrote:
> From my mpl-data directory, here's what's in the mathtext section of my
> matplotlibrc file:
> # The following settings allow you to select the fonts in math mode.
> # They map from a TeX font name to a fontconfig font pattern.
> # These settings are only used if mathtext.fontset is 'custom'.
> # Note that this "custom" mode is unsupported and may go away in the
> # future.
> #mathtext.cal : cursive
> #mathtext.rm : serif
> #mathtext.tt : monospace
> #mathtext.it : serif:italic
> #mathtext.bf : serif:bold
> #mathtext.sf : sans
> #mathtext.fontset : cm # Should be 'cm' (Computer Modern), 'stix',
> # 'stixsans' or 'custom'
> mathtext.fallback_to_cm : True # When True, use symbols from the Computer
> Modern
> # fonts when a symbol can not be found in one of
> # the custom math fonts.
>
> #mathtext.default : it # The default font to use for math.
> # Can be any of the LaTeX font names, including
> # the special name "regular" for the same font
>
>
> On Mon, Apr 19, 2010 at 2:40 PM, Michael Droettboom <md...@st...> wrote:
>
> 
>> The puzzling thing is this:
>>
>>
>> u'C:\\WINDOWS\\Fonts\\HTOWERTI.TTF'
>>
>> It's using a custom font in mathtext. Are you setting the rcParams
>> mathtext.fontset or mathtext.default? That may the culprit, and if not,
>> it's a bug that it's trying to use that font.
>>
>>
>> Mike
>>
>> william ratcliff wrote:
>>
>> 
>>> On the plus side, there is no longer an error when I apply the patch. On
>>> the downside, it generates a rather strange symbol instead of a
>>> perpendicular symbol....Let me try to quickly upgrade to 0.99.1. I did
>>> that
>>> and I seem to get the same error...
>>>
>>> On Mon, Apr 19, 2010 at 10:49 AM, Michael Droettboom <md...@st...
>>> 
>>>> wrote:
>>>> 
>>>
>>> 
>>>> Does forcibly casting the path to a string resolve the problem? i.e.
>>>> applying this patch:
>>>>
>>>> Index: mathtext.py
>>>> ===================================================================
>>>> --- mathtext.py (revision 8216)
>>>> +++ mathtext.py (working copy)
>>>> @@ -597,7 +597,7 @@
>>>>
>>>> cached_font = self._fonts.get(basename)
>>>> if cached_font is None:
>>>> - font = FT2Font(basename)
>>>> + font = FT2Font(str(basename))
>>>> cached_font = self.CachedFont(font)
>>>> self._fonts[basename] = cached_font
>>>> self._fonts[font.postscript_name] = cached_font
>>>>
>>>> Mike
>>>>
>>>> william ratcliff wrote:
>>>>
>>>>
>>>>
>>>> 
>>>>> Mike,
>>>>>
>>>>> The basename is:
>>>>> u'C:\\WINDOWS\\Fonts\\HTOWERTI.TTF'
>>>>>
>>>>> Let me try to find where my matplotlibrc file is located...
>>>>>
>>>>> Thanks,
>>>>> William
>>>>>
>>>>> On Mon, Apr 19, 2010 at 10:22 AM, Michael Droettboom <md...@st...
>>>>> <mailto:
>>>>> md...@st...>> wrote:
>>>>>
>>>>> One might see that error if the path to the font being used
>>>>> contains non-ascii characters (the "basename" variable in the last
>>>>> frame of the stack in the stacktrace). Is that possible? We may
>>>>> need to implement the same workaround we use for image files for
>>>>> loading fonts (which is to open the file with Python and pass a
>>>>> file handle to C++ rather than passing a string that may contain
>>>>> Unicode, which is difficult to handle in cross-platform way from
>>>>> C/C++).
>>>>>
>>>>> Mike
>>>>>
>>>>> william ratcliff wrote:
>>>>>
>>>>> I think the actual error was:
>>>>> TypeError: cannot return std::string from Unicode object
>>>>>
>>>>> It was the error returned when I walked through with a debugger...
>>>>>
>>>>> On Mon, Apr 19, 2010 at 8:51 AM, Michael Droettboom
>>>>> <md...@st... <mailto:md...@st...>
>>>>> <mailto:md...@st... <mailto:md...@st...>>> wrote:
>>>>>
>>>>> It looks like the end of the traceback -- where the actual
>>>>> exception is named -- is missing. Can you repost it in its
>>>>> entirety?
>>>>>
>>>>> Mike
>>>>>
>>>>> william ratcliff wrote:
>>>>>
>>>>> Hi! I am using matplotlib 0.99.0 under windows xp. I
>>>>> tried
>>>>> the following:
>>>>> ax.text(.96,.80,r'$P \perp
>>>>>
>>>>>
>>>>> Q$',fontsize=18,horizontalalignment='right',verticalalignment='top',transform=ax.transAxes,color='black')
>>>>> and get the following error:
>>>>> (However, in figure labels, symbols using mathtext, such as
>>>>> theta seem to work fine...)
>>>>>
>>>>> Thanks,
>>>>> William
>>>>>
>>>>> TypeError: cannot return std::string from Unicode object
>>>>> File
>>>>>
>>>>> "C:\mytripleaxisproject\trunk\eclipse\src\utilities\bfo_film_fig2.py",
>>>>> line 301, in <module>
>>>>> film110()
>>>>> File
>>>>>
>>>>> "C:\mytripleaxisproject\trunk\eclipse\src\utilities\bfo_film_fig2.py",
>>>>> line 157, in film110
>>>>> plt.show()
>>>>> File
>>>>>
>>>>> "C:\Python25\Lib\site-packages\matplotlib\backends\backend_qt4.py",
>>>>> line 63, in show
>>>>> manager.window.show()
>>>>> File
>>>>>
>>>>> "C:\Python25\Lib\site-packages\matplotlib\backends\backend_qt4.py",
>>>>> line 168, in resizeEvent
>>>>> self.draw()
>>>>> File
>>>>>
>>>>> "C:\Python25\Lib\site-packages\matplotlib\backends\backend_qt4agg.py",
>>>>> line 130, in draw
>>>>> FigureCanvasAgg.draw(self)
>>>>> File
>>>>>
>>>>> "C:\Python25\Lib\site-packages\matplotlib\backends\backend_agg.py",
>>>>> line 314, in draw
>>>>> self.figure.draw(self.renderer)
>>>>> File "C:\Python25\Lib\site-packages\matplotlib\artist.py",
>>>>> line 46, in draw_wrapper
>>>>> draw(artist, renderer, *kl)
>>>>> File "C:\Python25\Lib\site-packages\matplotlib\figure.py",
>>>>> line 774, in draw
>>>>> for a in self.axes: a.draw(renderer)
>>>>> File "C:\Python25\Lib\site-packages\matplotlib\artist.py",
>>>>> line 46, in draw_wrapper
>>>>> draw(artist, renderer, *kl)
>>>>> File
>>>>> "C:\Python25\Lib\site-packages\matplotlib\axes.py", line
>>>>> 1721, in draw
>>>>> a.draw(renderer)
>>>>> File
>>>>> "C:\Python25\Lib\site-packages\matplotlib\text.py", line
>>>>> 515, in draw
>>>>> bbox, info = self._get_layout(renderer)
>>>>> File
>>>>> "C:\Python25\Lib\site-packages\matplotlib\text.py", line
>>>>> 279, in _get_layout
>>>>> clean_line, self._fontproperties, ismath=ismath)
>>>>> File
>>>>>
>>>>> "C:\Python25\Lib\site-packages\matplotlib\backends\backend_agg.py",
>>>>> line 156, in get_text_width_height_descent
>>>>> self.mathtext_parser.parse(s, self.dpi, prop)
>>>>> File
>>>>> "C:\Python25\Lib\site-packages\matplotlib\mathtext.py",
>>>>> line 2810, in parse
>>>>> box = self._parser.parse(s, font_output, fontsize, dpi)
>>>>> File
>>>>> "C:\Python25\Lib\site-packages\matplotlib\mathtext.py",
>>>>> line 2259, in parse
>>>>> self._expression.parseString(s)
>>>>> File
>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>> line 1048, in parseString
>>>>> loc, tokens = self._parse( instring, 0 )
>>>>> File
>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>> line 981, in _parseCache
>>>>> value = self._parseNoCache( instring, loc, doActions,
>>>>> callPreParse )
>>>>> File
>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>> line 924, in _parseNoCache
>>>>> loc,tokens = self.parseImpl( instring, preloc, doActions )
>>>>> File
>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>> line 2559, in parseImpl
>>>>> return self.expr._parse( instring, loc, doActions,
>>>>> callPreParse=False )
>>>>> File
>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>> line 981, in _parseCache
>>>>> value = self._parseNoCache( instring, loc, doActions,
>>>>> callPreParse )
>>>>> File
>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>> line 924, in _parseNoCache
>>>>> loc,tokens = self.parseImpl( instring, preloc, doActions )
>>>>> File
>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>> line 2307, in parseImpl
>>>>> loc, exprtokens = e._parse( instring, loc, doActions )
>>>>> File
>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>> line 981, in _parseCache
>>>>> value = self._parseNoCache( instring, loc, doActions,
>>>>> callPreParse )
>>>>> File
>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>> line 924, in _parseNoCache
>>>>> loc,tokens = self.parseImpl( instring, preloc, doActions )
>>>>> File
>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>> line 2672, in parseImpl
>>>>> loc, tokens = self.expr._parse( instring, loc, doActions,
>>>>> callPreParse=False )
>>>>> File
>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>> line 981, in _parseCache
>>>>> value = self._parseNoCache( instring, loc, doActions,
>>>>> callPreParse )
>>>>> File
>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>> line 924, in _parseNoCache
>>>>> loc,tokens = self.parseImpl( instring, preloc, doActions )
>>>>> File
>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>> line 2307, in parseImpl
>>>>> loc, exprtokens = e._parse( instring, loc, doActions )
>>>>> File
>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>> line 981, in _parseCache
>>>>> value = self._parseNoCache( instring, loc, doActions,
>>>>> callPreParse )
>>>>> File
>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>> line 924, in _parseNoCache
>>>>> loc,tokens = self.parseImpl( instring, preloc, doActions )
>>>>> File
>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>> line 2756, in parseImpl
>>>>> loc, tokens = self.expr._parse( instring, loc, doActions,
>>>>> callPreParse=False )
>>>>> File
>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>> line 981, in _parseCache
>>>>> value = self._parseNoCache( instring, loc, doActions,
>>>>> callPreParse )
>>>>> File
>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>> line 924, in _parseNoCache
>>>>> loc,tokens = self.parseImpl( instring, preloc, doActions )
>>>>> File
>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>> line 2714, in parseImpl
>>>>> loc, tmptokens = self.expr._parse( instring, preloc,
>>>>> doActions )
>>>>> File
>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>> line 981, in _parseCache
>>>>> value = self._parseNoCache( instring, loc, doActions,
>>>>> callPreParse )
>>>>> File
>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>> line 924, in _parseNoCache
>>>>> loc,tokens = self.parseImpl( instring, preloc, doActions )
>>>>> File
>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>> line 2373, in parseImpl
>>>>> return maxMatchExp._parse( instring, loc, doActions )
>>>>> File
>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>> line 981, in _parseCache
>>>>> value = self._parseNoCache( instring, loc, doActions,
>>>>> callPreParse )
>>>>> File
>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>> line 924, in _parseNoCache
>>>>> loc,tokens = self.parseImpl( instring, preloc, doActions )
>>>>> File
>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>> line 2559, in parseImpl
>>>>> return self.expr._parse( instring, loc, doActions,
>>>>> callPreParse=False )
>>>>> File
>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>> line 981, in _parseCache
>>>>> value = self._parseNoCache( instring, loc, doActions,
>>>>> callPreParse )
>>>>> File
>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>> line 924, in _parseNoCache
>>>>> loc,tokens = self.parseImpl( instring, preloc, doActions )
>>>>> File
>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>> line 2416, in parseImpl
>>>>> ret = e._parse( instring, loc, doActions )
>>>>> File
>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>> line 981, in _parseCache
>>>>> value = self._parseNoCache( instring, loc, doActions,
>>>>> callPreParse )
>>>>> File
>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>> line 924, in _parseNoCache
>>>>> loc,tokens = self.parseImpl( instring, preloc, doActions )
>>>>> File
>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>> line 2559, in parseImpl
>>>>> return self.expr._parse( instring, loc, doActions,
>>>>> callPreParse=False )
>>>>> File
>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>> line 981, in _parseCache
>>>>> value = self._parseNoCache( instring, loc, doActions,
>>>>> callPreParse )
>>>>> File
>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>> line 924, in _parseNoCache
>>>>> loc,tokens = self.parseImpl( instring, preloc, doActions )
>>>>> File
>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>> line 2559, in parseImpl
>>>>> return self.expr._parse( instring, loc, doActions,
>>>>> callPreParse=False )
>>>>> File
>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>> line 981, in _parseCache
>>>>> value = self._parseNoCache( instring, loc, doActions,
>>>>> callPreParse )
>>>>> File
>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>> line 924, in _parseNoCache
>>>>> loc,tokens = self.parseImpl( instring, preloc, doActions )
>>>>> File
>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>> line 2416, in parseImpl
>>>>> ret = e._parse( instring, loc, doActions )
>>>>> File
>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>> line 981, in _parseCache
>>>>> value = self._parseNoCache( instring, loc, doActions,
>>>>> callPreParse )
>>>>> File
>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>> line 924, in _parseNoCache
>>>>> loc,tokens = self.parseImpl( instring, preloc, doActions )
>>>>> File
>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>> line 2293, in parseImpl
>>>>> loc, resultlist = self.exprs[0]._parse( instring, loc,
>>>>> doActions, callPreParse=False )
>>>>> File
>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>> line 981, in _parseCache
>>>>> value = self._parseNoCache( instring, loc, doActions,
>>>>> callPreParse )
>>>>> File
>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>> line 924, in _parseNoCache
>>>>> loc,tokens = self.parseImpl( instring, preloc, doActions )
>>>>> File
>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>> line 2756, in parseImpl
>>>>> loc, tokens = self.expr._parse( instring, loc, doActions,
>>>>> callPreParse=False )
>>>>> File
>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>> line 981, in _parseCache
>>>>> value = self._parseNoCache( instring, loc, doActions,
>>>>> callPreParse )
>>>>> File
>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>> line 924, in _parseNoCache
>>>>> loc,tokens = self.parseImpl( instring, preloc, doActions )
>>>>> File
>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>> line 2559, in parseImpl
>>>>> return self.expr._parse( instring, loc, doActions,
>>>>> callPreParse=False )
>>>>> File
>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>> line 981, in _parseCache
>>>>> value = self._parseNoCache( instring, loc, doActions,
>>>>> callPreParse )
>>>>> File
>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>> line 924, in _parseNoCache
>>>>> loc,tokens = self.parseImpl( instring, preloc, doActions )
>>>>> File
>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>> line 2373, in parseImpl
>>>>> return maxMatchExp._parse( instring, loc, doActions )
>>>>> File
>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>> line 981, in _parseCache
>>>>> value = self._parseNoCache( instring, loc, doActions,
>>>>> callPreParse )
>>>>> File
>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>> line 924, in _parseNoCache
>>>>> loc,tokens = self.parseImpl( instring, preloc, doActions )
>>>>> File
>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>> line 2416, in parseImpl
>>>>> ret = e._parse( instring, loc, doActions )
>>>>> File
>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>> line 981, in _parseCache
>>>>> value = self._parseNoCache( instring, loc, doActions,
>>>>> callPreParse )
>>>>> File
>>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>>> line 950, in _parseNoCache
>>>>> tokens = fn( instring, tokensStart, retTokens )
>>>>> File
>>>>> "C:\Python25\Lib\site-packages\matplotlib\mathtext.py",
>>>>> line 2374, in symbol
>>>>> char = Char(c, self.get_state())
>>>>> File
>>>>> "C:\Python25\Lib\site-packages\matplotlib\mathtext.py",
>>>>> line 1264, in __init__
>>>>> self._update_metrics()
>>>>> File
>>>>> "C:\Python25\Lib\site-packages\matplotlib\mathtext.py",
>>>>> line 1271, in _update_metrics
>>>>> self.font, self.font_class, self.c, self.fontsize,
>>>>> self.dpi)
>>>>> File
>>>>> "C:\Python25\Lib\site-packages\matplotlib\mathtext.py",
>>>>> line 446, in get_metrics
>>>>> info = self._get_info(font, font_class, sym, fontsize,
>>>>> dpi)
>>>>> File
>>>>> "C:\Python25\Lib\site-packages\matplotlib\mathtext.py",
>>>>> line 579, in _get_info
>>>>> self._get_glyph(fontname, font_class, sym, fontsize)
>>>>> File
>>>>> "C:\Python25\Lib\site-packages\matplotlib\mathtext.py",
>>>>> line 697, in _get_glyph
>>>>> fontname, font_class, sym, fontsize)
>>>>> File
>>>>> "C:\Python25\Lib\site-packages\matplotlib\mathtext.py",
>>>>> line 827, in _get_glyph
>>>>> cached_font = self._get_font(new_fontname)
>>>>> File
>>>>> "C:\Python25\Lib\site-packages\matplotlib\mathtext.py",
>>>>> line 560, in _get_font
>>>>> font = FT2Font(basename)
>>>>>
>>>>>
>>>>>
>>>>> ------------------------------------------------------------------------
>>>>>
>>>>>
>>>>>
>>>>> ------------------------------------------------------------------------------
>>>>> Download Intel&#174; Parallel Studio Eval
>>>>> Try the new software tools for yourself. Speed
>>>>> compiling, find
>>>>> bugs
>>>>> proactively, and fine-tune applications for parallel
>>>>> performance.
>>>>> See why Intel Parallel Studio got high marks during beta.
>>>>> http://p.sf.net/sfu/intel-sw-dev
>>>>>
>>>>>
>>>>> ------------------------------------------------------------------------
>>>>>
>>>>> _______________________________________________
>>>>> Matplotlib-users mailing list
>>>>> Mat...@li...
>>>>> <mailto:Mat...@li...>
>>>>> <mailto:Mat...@li...
>>>>> <mailto: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
>>>>>
>>>>>
>>>>>
>>>>> -- Michael Droettboom
>>>>> Science Software Branch
>>>>> Operations and Engineering Division
>>>>> Space Telescope Science Institute
>>>>> Operated by AURA for NASA
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> 
>>>> --
>>>> Michael Droettboom
>>>> Science Software Branch
>>>> Operations and Engineering Division
>>>> Space Telescope Science Institute
>>>> Operated by AURA for NASA
>>>>
>>>>
>>>>
>>>>
>>>> 
>>>
>>> 
>> --
>> Michael Droettboom
>> Science Software Branch
>> Operations and Engineering Division
>> Space Telescope Science Institute
>> Operated by AURA for NASA
>>
>>
>> 
>
> 
-- 
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA
From: william r. <wil...@gm...> - 2010年04月19日 19:36:54
>From my mpl-data directory, here's what's in the mathtext section of my
matplotlibrc file:
# The following settings allow you to select the fonts in math mode.
# They map from a TeX font name to a fontconfig font pattern.
# These settings are only used if mathtext.fontset is 'custom'.
# Note that this "custom" mode is unsupported and may go away in the
# future.
#mathtext.cal : cursive
#mathtext.rm : serif
#mathtext.tt : monospace
#mathtext.it : serif:italic
#mathtext.bf : serif:bold
#mathtext.sf : sans
#mathtext.fontset : cm # Should be 'cm' (Computer Modern), 'stix',
 # 'stixsans' or 'custom'
mathtext.fallback_to_cm : True # When True, use symbols from the Computer
Modern
 # fonts when a symbol can not be found in one of
 # the custom math fonts.
#mathtext.default : it # The default font to use for math.
 # Can be any of the LaTeX font names, including
 # the special name "regular" for the same font
On Mon, Apr 19, 2010 at 2:40 PM, Michael Droettboom <md...@st...> wrote:
> The puzzling thing is this:
>
>
> u'C:\\WINDOWS\\Fonts\\HTOWERTI.TTF'
>
> It's using a custom font in mathtext. Are you setting the rcParams
> mathtext.fontset or mathtext.default? That may the culprit, and if not,
> it's a bug that it's trying to use that font.
>
>
> Mike
>
> william ratcliff wrote:
>
>> On the plus side, there is no longer an error when I apply the patch. On
>> the downside, it generates a rather strange symbol instead of a
>> perpendicular symbol....Let me try to quickly upgrade to 0.99.1. I did
>> that
>> and I seem to get the same error...
>>
>> On Mon, Apr 19, 2010 at 10:49 AM, Michael Droettboom <md...@st...
>> >wrote:
>>
>>
>>
>>> Does forcibly casting the path to a string resolve the problem? i.e.
>>> applying this patch:
>>>
>>> Index: mathtext.py
>>> ===================================================================
>>> --- mathtext.py (revision 8216)
>>> +++ mathtext.py (working copy)
>>> @@ -597,7 +597,7 @@
>>>
>>> cached_font = self._fonts.get(basename)
>>> if cached_font is None:
>>> - font = FT2Font(basename)
>>> + font = FT2Font(str(basename))
>>> cached_font = self.CachedFont(font)
>>> self._fonts[basename] = cached_font
>>> self._fonts[font.postscript_name] = cached_font
>>>
>>> Mike
>>>
>>> william ratcliff wrote:
>>>
>>>
>>>
>>>> Mike,
>>>>
>>>> The basename is:
>>>> u'C:\\WINDOWS\\Fonts\\HTOWERTI.TTF'
>>>>
>>>> Let me try to find where my matplotlibrc file is located...
>>>>
>>>> Thanks,
>>>> William
>>>>
>>>> On Mon, Apr 19, 2010 at 10:22 AM, Michael Droettboom <md...@st...
>>>> <mailto:
>>>> md...@st...>> wrote:
>>>>
>>>> One might see that error if the path to the font being used
>>>> contains non-ascii characters (the "basename" variable in the last
>>>> frame of the stack in the stacktrace). Is that possible? We may
>>>> need to implement the same workaround we use for image files for
>>>> loading fonts (which is to open the file with Python and pass a
>>>> file handle to C++ rather than passing a string that may contain
>>>> Unicode, which is difficult to handle in cross-platform way from
>>>> C/C++).
>>>>
>>>> Mike
>>>>
>>>> william ratcliff wrote:
>>>>
>>>> I think the actual error was:
>>>> TypeError: cannot return std::string from Unicode object
>>>>
>>>> It was the error returned when I walked through with a debugger...
>>>>
>>>> On Mon, Apr 19, 2010 at 8:51 AM, Michael Droettboom
>>>> <md...@st... <mailto:md...@st...>
>>>> <mailto:md...@st... <mailto:md...@st...>>> wrote:
>>>>
>>>> It looks like the end of the traceback -- where the actual
>>>> exception is named -- is missing. Can you repost it in its
>>>> entirety?
>>>>
>>>> Mike
>>>>
>>>> william ratcliff wrote:
>>>>
>>>> Hi! I am using matplotlib 0.99.0 under windows xp. I
>>>> tried
>>>> the following:
>>>> ax.text(.96,.80,r'$P \perp
>>>>
>>>>
>>>> Q$',fontsize=18,horizontalalignment='right',verticalalignment='top',transform=ax.transAxes,color='black')
>>>> and get the following error:
>>>> (However, in figure labels, symbols using mathtext, such as
>>>> theta seem to work fine...)
>>>>
>>>> Thanks,
>>>> William
>>>>
>>>> TypeError: cannot return std::string from Unicode object
>>>> File
>>>>
>>>> "C:\mytripleaxisproject\trunk\eclipse\src\utilities\bfo_film_fig2.py",
>>>> line 301, in <module>
>>>> film110()
>>>> File
>>>>
>>>> "C:\mytripleaxisproject\trunk\eclipse\src\utilities\bfo_film_fig2.py",
>>>> line 157, in film110
>>>> plt.show()
>>>> File
>>>>
>>>> "C:\Python25\Lib\site-packages\matplotlib\backends\backend_qt4.py",
>>>> line 63, in show
>>>> manager.window.show()
>>>> File
>>>>
>>>> "C:\Python25\Lib\site-packages\matplotlib\backends\backend_qt4.py",
>>>> line 168, in resizeEvent
>>>> self.draw()
>>>> File
>>>>
>>>> "C:\Python25\Lib\site-packages\matplotlib\backends\backend_qt4agg.py",
>>>> line 130, in draw
>>>> FigureCanvasAgg.draw(self)
>>>> File
>>>>
>>>> "C:\Python25\Lib\site-packages\matplotlib\backends\backend_agg.py",
>>>> line 314, in draw
>>>> self.figure.draw(self.renderer)
>>>> File "C:\Python25\Lib\site-packages\matplotlib\artist.py",
>>>> line 46, in draw_wrapper
>>>> draw(artist, renderer, *kl)
>>>> File "C:\Python25\Lib\site-packages\matplotlib\figure.py",
>>>> line 774, in draw
>>>> for a in self.axes: a.draw(renderer)
>>>> File "C:\Python25\Lib\site-packages\matplotlib\artist.py",
>>>> line 46, in draw_wrapper
>>>> draw(artist, renderer, *kl)
>>>> File
>>>> "C:\Python25\Lib\site-packages\matplotlib\axes.py", line
>>>> 1721, in draw
>>>> a.draw(renderer)
>>>> File
>>>> "C:\Python25\Lib\site-packages\matplotlib\text.py", line
>>>> 515, in draw
>>>> bbox, info = self._get_layout(renderer)
>>>> File
>>>> "C:\Python25\Lib\site-packages\matplotlib\text.py", line
>>>> 279, in _get_layout
>>>> clean_line, self._fontproperties, ismath=ismath)
>>>> File
>>>>
>>>> "C:\Python25\Lib\site-packages\matplotlib\backends\backend_agg.py",
>>>> line 156, in get_text_width_height_descent
>>>> self.mathtext_parser.parse(s, self.dpi, prop)
>>>> File
>>>> "C:\Python25\Lib\site-packages\matplotlib\mathtext.py",
>>>> line 2810, in parse
>>>> box = self._parser.parse(s, font_output, fontsize, dpi)
>>>> File
>>>> "C:\Python25\Lib\site-packages\matplotlib\mathtext.py",
>>>> line 2259, in parse
>>>> self._expression.parseString(s)
>>>> File
>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>> line 1048, in parseString
>>>> loc, tokens = self._parse( instring, 0 )
>>>> File
>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>> line 981, in _parseCache
>>>> value = self._parseNoCache( instring, loc, doActions,
>>>> callPreParse )
>>>> File
>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>> line 924, in _parseNoCache
>>>> loc,tokens = self.parseImpl( instring, preloc, doActions )
>>>> File
>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>> line 2559, in parseImpl
>>>> return self.expr._parse( instring, loc, doActions,
>>>> callPreParse=False )
>>>> File
>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>> line 981, in _parseCache
>>>> value = self._parseNoCache( instring, loc, doActions,
>>>> callPreParse )
>>>> File
>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>> line 924, in _parseNoCache
>>>> loc,tokens = self.parseImpl( instring, preloc, doActions )
>>>> File
>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>> line 2307, in parseImpl
>>>> loc, exprtokens = e._parse( instring, loc, doActions )
>>>> File
>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>> line 981, in _parseCache
>>>> value = self._parseNoCache( instring, loc, doActions,
>>>> callPreParse )
>>>> File
>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>> line 924, in _parseNoCache
>>>> loc,tokens = self.parseImpl( instring, preloc, doActions )
>>>> File
>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>> line 2672, in parseImpl
>>>> loc, tokens = self.expr._parse( instring, loc, doActions,
>>>> callPreParse=False )
>>>> File
>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>> line 981, in _parseCache
>>>> value = self._parseNoCache( instring, loc, doActions,
>>>> callPreParse )
>>>> File
>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>> line 924, in _parseNoCache
>>>> loc,tokens = self.parseImpl( instring, preloc, doActions )
>>>> File
>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>> line 2307, in parseImpl
>>>> loc, exprtokens = e._parse( instring, loc, doActions )
>>>> File
>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>> line 981, in _parseCache
>>>> value = self._parseNoCache( instring, loc, doActions,
>>>> callPreParse )
>>>> File
>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>> line 924, in _parseNoCache
>>>> loc,tokens = self.parseImpl( instring, preloc, doActions )
>>>> File
>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>> line 2756, in parseImpl
>>>> loc, tokens = self.expr._parse( instring, loc, doActions,
>>>> callPreParse=False )
>>>> File
>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>> line 981, in _parseCache
>>>> value = self._parseNoCache( instring, loc, doActions,
>>>> callPreParse )
>>>> File
>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>> line 924, in _parseNoCache
>>>> loc,tokens = self.parseImpl( instring, preloc, doActions )
>>>> File
>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>> line 2714, in parseImpl
>>>> loc, tmptokens = self.expr._parse( instring, preloc,
>>>> doActions )
>>>> File
>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>> line 981, in _parseCache
>>>> value = self._parseNoCache( instring, loc, doActions,
>>>> callPreParse )
>>>> File
>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>> line 924, in _parseNoCache
>>>> loc,tokens = self.parseImpl( instring, preloc, doActions )
>>>> File
>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>> line 2373, in parseImpl
>>>> return maxMatchExp._parse( instring, loc, doActions )
>>>> File
>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>> line 981, in _parseCache
>>>> value = self._parseNoCache( instring, loc, doActions,
>>>> callPreParse )
>>>> File
>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>> line 924, in _parseNoCache
>>>> loc,tokens = self.parseImpl( instring, preloc, doActions )
>>>> File
>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>> line 2559, in parseImpl
>>>> return self.expr._parse( instring, loc, doActions,
>>>> callPreParse=False )
>>>> File
>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>> line 981, in _parseCache
>>>> value = self._parseNoCache( instring, loc, doActions,
>>>> callPreParse )
>>>> File
>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>> line 924, in _parseNoCache
>>>> loc,tokens = self.parseImpl( instring, preloc, doActions )
>>>> File
>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>> line 2416, in parseImpl
>>>> ret = e._parse( instring, loc, doActions )
>>>> File
>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>> line 981, in _parseCache
>>>> value = self._parseNoCache( instring, loc, doActions,
>>>> callPreParse )
>>>> File
>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>> line 924, in _parseNoCache
>>>> loc,tokens = self.parseImpl( instring, preloc, doActions )
>>>> File
>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>> line 2559, in parseImpl
>>>> return self.expr._parse( instring, loc, doActions,
>>>> callPreParse=False )
>>>> File
>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>> line 981, in _parseCache
>>>> value = self._parseNoCache( instring, loc, doActions,
>>>> callPreParse )
>>>> File
>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>> line 924, in _parseNoCache
>>>> loc,tokens = self.parseImpl( instring, preloc, doActions )
>>>> File
>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>> line 2559, in parseImpl
>>>> return self.expr._parse( instring, loc, doActions,
>>>> callPreParse=False )
>>>> File
>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>> line 981, in _parseCache
>>>> value = self._parseNoCache( instring, loc, doActions,
>>>> callPreParse )
>>>> File
>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>> line 924, in _parseNoCache
>>>> loc,tokens = self.parseImpl( instring, preloc, doActions )
>>>> File
>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>> line 2416, in parseImpl
>>>> ret = e._parse( instring, loc, doActions )
>>>> File
>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>> line 981, in _parseCache
>>>> value = self._parseNoCache( instring, loc, doActions,
>>>> callPreParse )
>>>> File
>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>> line 924, in _parseNoCache
>>>> loc,tokens = self.parseImpl( instring, preloc, doActions )
>>>> File
>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>> line 2293, in parseImpl
>>>> loc, resultlist = self.exprs[0]._parse( instring, loc,
>>>> doActions, callPreParse=False )
>>>> File
>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>> line 981, in _parseCache
>>>> value = self._parseNoCache( instring, loc, doActions,
>>>> callPreParse )
>>>> File
>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>> line 924, in _parseNoCache
>>>> loc,tokens = self.parseImpl( instring, preloc, doActions )
>>>> File
>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>> line 2756, in parseImpl
>>>> loc, tokens = self.expr._parse( instring, loc, doActions,
>>>> callPreParse=False )
>>>> File
>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>> line 981, in _parseCache
>>>> value = self._parseNoCache( instring, loc, doActions,
>>>> callPreParse )
>>>> File
>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>> line 924, in _parseNoCache
>>>> loc,tokens = self.parseImpl( instring, preloc, doActions )
>>>> File
>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>> line 2559, in parseImpl
>>>> return self.expr._parse( instring, loc, doActions,
>>>> callPreParse=False )
>>>> File
>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>> line 981, in _parseCache
>>>> value = self._parseNoCache( instring, loc, doActions,
>>>> callPreParse )
>>>> File
>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>> line 924, in _parseNoCache
>>>> loc,tokens = self.parseImpl( instring, preloc, doActions )
>>>> File
>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>> line 2373, in parseImpl
>>>> return maxMatchExp._parse( instring, loc, doActions )
>>>> File
>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>> line 981, in _parseCache
>>>> value = self._parseNoCache( instring, loc, doActions,
>>>> callPreParse )
>>>> File
>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>> line 924, in _parseNoCache
>>>> loc,tokens = self.parseImpl( instring, preloc, doActions )
>>>> File
>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>> line 2416, in parseImpl
>>>> ret = e._parse( instring, loc, doActions )
>>>> File
>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>> line 981, in _parseCache
>>>> value = self._parseNoCache( instring, loc, doActions,
>>>> callPreParse )
>>>> File
>>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>>> line 950, in _parseNoCache
>>>> tokens = fn( instring, tokensStart, retTokens )
>>>> File
>>>> "C:\Python25\Lib\site-packages\matplotlib\mathtext.py",
>>>> line 2374, in symbol
>>>> char = Char(c, self.get_state())
>>>> File
>>>> "C:\Python25\Lib\site-packages\matplotlib\mathtext.py",
>>>> line 1264, in __init__
>>>> self._update_metrics()
>>>> File
>>>> "C:\Python25\Lib\site-packages\matplotlib\mathtext.py",
>>>> line 1271, in _update_metrics
>>>> self.font, self.font_class, self.c, self.fontsize,
>>>> self.dpi)
>>>> File
>>>> "C:\Python25\Lib\site-packages\matplotlib\mathtext.py",
>>>> line 446, in get_metrics
>>>> info = self._get_info(font, font_class, sym, fontsize,
>>>> dpi)
>>>> File
>>>> "C:\Python25\Lib\site-packages\matplotlib\mathtext.py",
>>>> line 579, in _get_info
>>>> self._get_glyph(fontname, font_class, sym, fontsize)
>>>> File
>>>> "C:\Python25\Lib\site-packages\matplotlib\mathtext.py",
>>>> line 697, in _get_glyph
>>>> fontname, font_class, sym, fontsize)
>>>> File
>>>> "C:\Python25\Lib\site-packages\matplotlib\mathtext.py",
>>>> line 827, in _get_glyph
>>>> cached_font = self._get_font(new_fontname)
>>>> File
>>>> "C:\Python25\Lib\site-packages\matplotlib\mathtext.py",
>>>> line 560, in _get_font
>>>> font = FT2Font(basename)
>>>>
>>>>
>>>>
>>>> ------------------------------------------------------------------------
>>>>
>>>>
>>>>
>>>> ------------------------------------------------------------------------------
>>>> Download Intel&#174; Parallel Studio Eval
>>>> Try the new software tools for yourself. Speed
>>>> compiling, find
>>>> bugs
>>>> proactively, and fine-tune applications for parallel
>>>> performance.
>>>> See why Intel Parallel Studio got high marks during beta.
>>>> http://p.sf.net/sfu/intel-sw-dev
>>>>
>>>>
>>>> ------------------------------------------------------------------------
>>>>
>>>> _______________________________________________
>>>> Matplotlib-users mailing list
>>>> Mat...@li...
>>>> <mailto:Mat...@li...>
>>>> <mailto:Mat...@li...
>>>> <mailto: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
>>>>
>>>>
>>>>
>>>> -- Michael Droettboom
>>>> Science Software Branch
>>>> Operations and Engineering Division
>>>> Space Telescope Science Institute
>>>> Operated by AURA for NASA
>>>>
>>>>
>>>>
>>>>
>>>>
>>> --
>>> Michael Droettboom
>>> Science Software Branch
>>> Operations and Engineering Division
>>> Space Telescope Science Institute
>>> Operated by AURA for NASA
>>>
>>>
>>>
>>>
>>
>>
>>
>
> --
> Michael Droettboom
> Science Software Branch
> Operations and Engineering Division
> Space Telescope Science Institute
> Operated by AURA for NASA
>
>
From: Michael D. <md...@st...> - 2010年04月19日 19:33:13
Friedrich Romstedt wrote:
> 2010年4月19日 Friedrich Romstedt <fri...@gm...>:
> 
> What is the advantage of using
> matplotlib.ticker.ScalarFormatter(useMathText = True) then, when it's
> typeset in outside-math font anyway?
> 
It's the only way to get superscripts (well, Unicode has superscript 
numerals, but the formatter doesn't currently use them).
Mike
-- 
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA
From: Friedrich R. <fri...@gm...> - 2010年04月19日 19:28:25
2010年4月19日 Friedrich Romstedt <fri...@gm...>:
> http://matplotlib.sourceforge.net/api/ticker_api.html#matplotlib.ticker.FuncFormatter
> For exponential ticks, I would propose (but it's untested):
>
>>>> def exp_fmt(loc):
>    exponent = numpy.round(numpy.log10(loc))
>    return '10ドル^%d$' % exponent
>>>> formatter = matplotlib.ticker.FuncFormatter(exp_fmt)
>>>> # And so on.
Well, as JJ pointed out recently, there is
matplotlib.ticker.LogFormatterMathtext as a much better template to
use ... Well, and even for scalar formatters, there is
matplotlib.ticker.ScalarFormatter(useMathText = True) ... Shame on me!
But it seems there is a small drawback: For non-rc-usetex mode,
\mathdefault{} is used, making the math typeset in the normal,
outside-math font (according to
http://matplotlib.sourceforge.net/users/mathtext.html?highlight=mathdefault#fonts).
 What is the advantage of using
matplotlib.ticker.ScalarFormatter(useMathText = True) then, when it's
typeset in outside-math font anyway?
Friedrich
From: Eric F. <ef...@ha...> - 2010年04月19日 19:09:13
David Ho wrote:
> Just as an illustration, I'm looking for a nice way to plot something 
> like this:
> http://labrosa.ee.columbia.edu/matlab/sgram/
> 
> I don't necessarily need a weighting matrix to convert the Pxx array, 
> which is what Dan Ellis' code does; I just need to visualize the 
> spectrogram on a logarithmic axis.
> 
> Is there any built-in way to do this?
David,
The components exist, but they have not been assembled. One approach 
would be to use the NonUniformImage class in place of image to handle 
the log axis case. A variation would be to use pcolorfast. Evidently 
we need to add a log scale option to the existing specgram. I can't do 
it right now--maybe someone else will.
Eric
> 
> I'd just like to be able to call specgram(), and then call something 
> like yscale('log', basey=10), to change the y-axis to be logarithmic, 
> stretching or compressing different areas of the image appropriately. 
> The equivalent code would work in MATLAB. However, this doesn't seem to 
> work with matplotlib (I just get an empty figure).
> Similarly, I couldn't get matplotlib.pyplot.semilogy() to work; I get 
> the warning: "Images are not supported on non-linear axes."
> 
> Does anyone have any ideas?
> Thanks!
> 
> --David Ho
> 
> 
> On Thu, Apr 15, 2010 at 12:27 PM, David Ho <it...@uc... 
> <mailto:it...@uc...>> wrote:
> 
> Hi all!
> 
> I have a quick newbie question.
> matplotlib's specgram() by default plots a spectrogram with a linear
> y-axis (frequency).
> However, for many applications, it's better to look at a
> log-frequency spectrogram.
> 
> Is there an easy way to plot a spectrogram using a logarithmic
> frequency axis?
> 
> Thanks for your help!
> 
> --David Ho
> 
From: Michael D. <md...@st...> - 2010年04月19日 18:41:06
The puzzling thing is this:
u'C:\\WINDOWS\\Fonts\\HTOWERTI.TTF'
It's using a custom font in mathtext. Are you setting the rcParams 
mathtext.fontset or mathtext.default? That may the culprit, and if not, 
it's a bug that it's trying to use that font.
Mike
william ratcliff wrote:
> On the plus side, there is no longer an error when I apply the patch. On
> the downside, it generates a rather strange symbol instead of a
> perpendicular symbol....Let me try to quickly upgrade to 0.99.1. I did that
> and I seem to get the same error...
>
> On Mon, Apr 19, 2010 at 10:49 AM, Michael Droettboom <md...@st...>wrote:
>
> 
>> Does forcibly casting the path to a string resolve the problem? i.e.
>> applying this patch:
>>
>> Index: mathtext.py
>> ===================================================================
>> --- mathtext.py (revision 8216)
>> +++ mathtext.py (working copy)
>> @@ -597,7 +597,7 @@
>>
>> cached_font = self._fonts.get(basename)
>> if cached_font is None:
>> - font = FT2Font(basename)
>> + font = FT2Font(str(basename))
>> cached_font = self.CachedFont(font)
>> self._fonts[basename] = cached_font
>> self._fonts[font.postscript_name] = cached_font
>>
>> Mike
>>
>> william ratcliff wrote:
>>
>> 
>>> Mike,
>>>
>>> The basename is:
>>> u'C:\\WINDOWS\\Fonts\\HTOWERTI.TTF'
>>>
>>> Let me try to find where my matplotlibrc file is located...
>>>
>>> Thanks,
>>> William
>>>
>>> On Mon, Apr 19, 2010 at 10:22 AM, Michael Droettboom <md...@st...<mailto:
>>> md...@st...>> wrote:
>>>
>>> One might see that error if the path to the font being used
>>> contains non-ascii characters (the "basename" variable in the last
>>> frame of the stack in the stacktrace). Is that possible? We may
>>> need to implement the same workaround we use for image files for
>>> loading fonts (which is to open the file with Python and pass a
>>> file handle to C++ rather than passing a string that may contain
>>> Unicode, which is difficult to handle in cross-platform way from
>>> C/C++).
>>>
>>> Mike
>>>
>>> william ratcliff wrote:
>>>
>>> I think the actual error was:
>>> TypeError: cannot return std::string from Unicode object
>>>
>>> It was the error returned when I walked through with a debugger...
>>>
>>> On Mon, Apr 19, 2010 at 8:51 AM, Michael Droettboom
>>> <md...@st... <mailto:md...@st...>
>>> <mailto:md...@st... <mailto:md...@st...>>> wrote:
>>>
>>> It looks like the end of the traceback -- where the actual
>>> exception is named -- is missing. Can you repost it in its
>>> entirety?
>>>
>>> Mike
>>>
>>> william ratcliff wrote:
>>>
>>> Hi! I am using matplotlib 0.99.0 under windows xp. I
>>> tried
>>> the following:
>>> ax.text(.96,.80,r'$P \perp
>>>
>>> Q$',fontsize=18,horizontalalignment='right',verticalalignment='top',transform=ax.transAxes,color='black')
>>> and get the following error:
>>> (However, in figure labels, symbols using mathtext, such as
>>> theta seem to work fine...)
>>>
>>> Thanks,
>>> William
>>>
>>> TypeError: cannot return std::string from Unicode object
>>> File
>>>
>>> "C:\mytripleaxisproject\trunk\eclipse\src\utilities\bfo_film_fig2.py",
>>> line 301, in <module>
>>> film110()
>>> File
>>>
>>> "C:\mytripleaxisproject\trunk\eclipse\src\utilities\bfo_film_fig2.py",
>>> line 157, in film110
>>> plt.show()
>>> File
>>>
>>> "C:\Python25\Lib\site-packages\matplotlib\backends\backend_qt4.py",
>>> line 63, in show
>>> manager.window.show()
>>> File
>>>
>>> "C:\Python25\Lib\site-packages\matplotlib\backends\backend_qt4.py",
>>> line 168, in resizeEvent
>>> self.draw()
>>> File
>>>
>>> "C:\Python25\Lib\site-packages\matplotlib\backends\backend_qt4agg.py",
>>> line 130, in draw
>>> FigureCanvasAgg.draw(self)
>>> File
>>>
>>> "C:\Python25\Lib\site-packages\matplotlib\backends\backend_agg.py",
>>> line 314, in draw
>>> self.figure.draw(self.renderer)
>>> File "C:\Python25\Lib\site-packages\matplotlib\artist.py",
>>> line 46, in draw_wrapper
>>> draw(artist, renderer, *kl)
>>> File "C:\Python25\Lib\site-packages\matplotlib\figure.py",
>>> line 774, in draw
>>> for a in self.axes: a.draw(renderer)
>>> File "C:\Python25\Lib\site-packages\matplotlib\artist.py",
>>> line 46, in draw_wrapper
>>> draw(artist, renderer, *kl)
>>> File
>>> "C:\Python25\Lib\site-packages\matplotlib\axes.py", line
>>> 1721, in draw
>>> a.draw(renderer)
>>> File
>>> "C:\Python25\Lib\site-packages\matplotlib\text.py", line
>>> 515, in draw
>>> bbox, info = self._get_layout(renderer)
>>> File
>>> "C:\Python25\Lib\site-packages\matplotlib\text.py", line
>>> 279, in _get_layout
>>> clean_line, self._fontproperties, ismath=ismath)
>>> File
>>>
>>> "C:\Python25\Lib\site-packages\matplotlib\backends\backend_agg.py",
>>> line 156, in get_text_width_height_descent
>>> self.mathtext_parser.parse(s, self.dpi, prop)
>>> File
>>> "C:\Python25\Lib\site-packages\matplotlib\mathtext.py",
>>> line 2810, in parse
>>> box = self._parser.parse(s, font_output, fontsize, dpi)
>>> File
>>> "C:\Python25\Lib\site-packages\matplotlib\mathtext.py",
>>> line 2259, in parse
>>> self._expression.parseString(s)
>>> File
>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>> line 1048, in parseString
>>> loc, tokens = self._parse( instring, 0 )
>>> File
>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>> line 981, in _parseCache
>>> value = self._parseNoCache( instring, loc, doActions,
>>> callPreParse )
>>> File
>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>> line 924, in _parseNoCache
>>> loc,tokens = self.parseImpl( instring, preloc, doActions )
>>> File
>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>> line 2559, in parseImpl
>>> return self.expr._parse( instring, loc, doActions,
>>> callPreParse=False )
>>> File
>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>> line 981, in _parseCache
>>> value = self._parseNoCache( instring, loc, doActions,
>>> callPreParse )
>>> File
>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>> line 924, in _parseNoCache
>>> loc,tokens = self.parseImpl( instring, preloc, doActions )
>>> File
>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>> line 2307, in parseImpl
>>> loc, exprtokens = e._parse( instring, loc, doActions )
>>> File
>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>> line 981, in _parseCache
>>> value = self._parseNoCache( instring, loc, doActions,
>>> callPreParse )
>>> File
>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>> line 924, in _parseNoCache
>>> loc,tokens = self.parseImpl( instring, preloc, doActions )
>>> File
>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>> line 2672, in parseImpl
>>> loc, tokens = self.expr._parse( instring, loc, doActions,
>>> callPreParse=False )
>>> File
>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>> line 981, in _parseCache
>>> value = self._parseNoCache( instring, loc, doActions,
>>> callPreParse )
>>> File
>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>> line 924, in _parseNoCache
>>> loc,tokens = self.parseImpl( instring, preloc, doActions )
>>> File
>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>> line 2307, in parseImpl
>>> loc, exprtokens = e._parse( instring, loc, doActions )
>>> File
>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>> line 981, in _parseCache
>>> value = self._parseNoCache( instring, loc, doActions,
>>> callPreParse )
>>> File
>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>> line 924, in _parseNoCache
>>> loc,tokens = self.parseImpl( instring, preloc, doActions )
>>> File
>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>> line 2756, in parseImpl
>>> loc, tokens = self.expr._parse( instring, loc, doActions,
>>> callPreParse=False )
>>> File
>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>> line 981, in _parseCache
>>> value = self._parseNoCache( instring, loc, doActions,
>>> callPreParse )
>>> File
>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>> line 924, in _parseNoCache
>>> loc,tokens = self.parseImpl( instring, preloc, doActions )
>>> File
>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>> line 2714, in parseImpl
>>> loc, tmptokens = self.expr._parse( instring, preloc,
>>> doActions )
>>> File
>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>> line 981, in _parseCache
>>> value = self._parseNoCache( instring, loc, doActions,
>>> callPreParse )
>>> File
>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>> line 924, in _parseNoCache
>>> loc,tokens = self.parseImpl( instring, preloc, doActions )
>>> File
>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>> line 2373, in parseImpl
>>> return maxMatchExp._parse( instring, loc, doActions )
>>> File
>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>> line 981, in _parseCache
>>> value = self._parseNoCache( instring, loc, doActions,
>>> callPreParse )
>>> File
>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>> line 924, in _parseNoCache
>>> loc,tokens = self.parseImpl( instring, preloc, doActions )
>>> File
>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>> line 2559, in parseImpl
>>> return self.expr._parse( instring, loc, doActions,
>>> callPreParse=False )
>>> File
>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>> line 981, in _parseCache
>>> value = self._parseNoCache( instring, loc, doActions,
>>> callPreParse )
>>> File
>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>> line 924, in _parseNoCache
>>> loc,tokens = self.parseImpl( instring, preloc, doActions )
>>> File
>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>> line 2416, in parseImpl
>>> ret = e._parse( instring, loc, doActions )
>>> File
>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>> line 981, in _parseCache
>>> value = self._parseNoCache( instring, loc, doActions,
>>> callPreParse )
>>> File
>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>> line 924, in _parseNoCache
>>> loc,tokens = self.parseImpl( instring, preloc, doActions )
>>> File
>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>> line 2559, in parseImpl
>>> return self.expr._parse( instring, loc, doActions,
>>> callPreParse=False )
>>> File
>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>> line 981, in _parseCache
>>> value = self._parseNoCache( instring, loc, doActions,
>>> callPreParse )
>>> File
>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>> line 924, in _parseNoCache
>>> loc,tokens = self.parseImpl( instring, preloc, doActions )
>>> File
>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>> line 2559, in parseImpl
>>> return self.expr._parse( instring, loc, doActions,
>>> callPreParse=False )
>>> File
>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>> line 981, in _parseCache
>>> value = self._parseNoCache( instring, loc, doActions,
>>> callPreParse )
>>> File
>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>> line 924, in _parseNoCache
>>> loc,tokens = self.parseImpl( instring, preloc, doActions )
>>> File
>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>> line 2416, in parseImpl
>>> ret = e._parse( instring, loc, doActions )
>>> File
>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>> line 981, in _parseCache
>>> value = self._parseNoCache( instring, loc, doActions,
>>> callPreParse )
>>> File
>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>> line 924, in _parseNoCache
>>> loc,tokens = self.parseImpl( instring, preloc, doActions )
>>> File
>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>> line 2293, in parseImpl
>>> loc, resultlist = self.exprs[0]._parse( instring, loc,
>>> doActions, callPreParse=False )
>>> File
>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>> line 981, in _parseCache
>>> value = self._parseNoCache( instring, loc, doActions,
>>> callPreParse )
>>> File
>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>> line 924, in _parseNoCache
>>> loc,tokens = self.parseImpl( instring, preloc, doActions )
>>> File
>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>> line 2756, in parseImpl
>>> loc, tokens = self.expr._parse( instring, loc, doActions,
>>> callPreParse=False )
>>> File
>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>> line 981, in _parseCache
>>> value = self._parseNoCache( instring, loc, doActions,
>>> callPreParse )
>>> File
>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>> line 924, in _parseNoCache
>>> loc,tokens = self.parseImpl( instring, preloc, doActions )
>>> File
>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>> line 2559, in parseImpl
>>> return self.expr._parse( instring, loc, doActions,
>>> callPreParse=False )
>>> File
>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>> line 981, in _parseCache
>>> value = self._parseNoCache( instring, loc, doActions,
>>> callPreParse )
>>> File
>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>> line 924, in _parseNoCache
>>> loc,tokens = self.parseImpl( instring, preloc, doActions )
>>> File
>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>> line 2373, in parseImpl
>>> return maxMatchExp._parse( instring, loc, doActions )
>>> File
>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>> line 981, in _parseCache
>>> value = self._parseNoCache( instring, loc, doActions,
>>> callPreParse )
>>> File
>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>> line 924, in _parseNoCache
>>> loc,tokens = self.parseImpl( instring, preloc, doActions )
>>> File
>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>> line 2416, in parseImpl
>>> ret = e._parse( instring, loc, doActions )
>>> File
>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>> line 981, in _parseCache
>>> value = self._parseNoCache( instring, loc, doActions,
>>> callPreParse )
>>> File
>>> "C:\Python25\Lib\site-packages\matplotlib\pyparsing.py",
>>> line 950, in _parseNoCache
>>> tokens = fn( instring, tokensStart, retTokens )
>>> File
>>> "C:\Python25\Lib\site-packages\matplotlib\mathtext.py",
>>> line 2374, in symbol
>>> char = Char(c, self.get_state())
>>> File
>>> "C:\Python25\Lib\site-packages\matplotlib\mathtext.py",
>>> line 1264, in __init__
>>> self._update_metrics()
>>> File
>>> "C:\Python25\Lib\site-packages\matplotlib\mathtext.py",
>>> line 1271, in _update_metrics
>>> self.font, self.font_class, self.c, self.fontsize,
>>> self.dpi)
>>> File
>>> "C:\Python25\Lib\site-packages\matplotlib\mathtext.py",
>>> line 446, in get_metrics
>>> info = self._get_info(font, font_class, sym, fontsize,
>>> dpi)
>>> File
>>> "C:\Python25\Lib\site-packages\matplotlib\mathtext.py",
>>> line 579, in _get_info
>>> self._get_glyph(fontname, font_class, sym, fontsize)
>>> File
>>> "C:\Python25\Lib\site-packages\matplotlib\mathtext.py",
>>> line 697, in _get_glyph
>>> fontname, font_class, sym, fontsize)
>>> File
>>> "C:\Python25\Lib\site-packages\matplotlib\mathtext.py",
>>> line 827, in _get_glyph
>>> cached_font = self._get_font(new_fontname)
>>> File
>>> "C:\Python25\Lib\site-packages\matplotlib\mathtext.py",
>>> line 560, in _get_font
>>> font = FT2Font(basename)
>>>
>>>
>>> ------------------------------------------------------------------------
>>>
>>>
>>> ------------------------------------------------------------------------------
>>> Download Intel&#174; Parallel Studio Eval
>>> Try the new software tools for yourself. Speed
>>> compiling, find
>>> bugs
>>> proactively, and fine-tune applications for parallel
>>> performance.
>>> See why Intel Parallel Studio got high marks during beta.
>>> http://p.sf.net/sfu/intel-sw-dev
>>>
>>> ------------------------------------------------------------------------
>>>
>>> _______________________________________________
>>> Matplotlib-users mailing list
>>> Mat...@li...
>>> <mailto:Mat...@li...>
>>> <mailto:Mat...@li...
>>> <mailto: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
>>>
>>>
>>>
>>> -- Michael Droettboom
>>> Science Software Branch
>>> Operations and Engineering Division
>>> Space Telescope Science Institute
>>> Operated by AURA for NASA
>>>
>>>
>>>
>>> 
>> --
>> Michael Droettboom
>> Science Software Branch
>> Operations and Engineering Division
>> Space Telescope Science Institute
>> Operated by AURA for NASA
>>
>>
>> 
>
> 
-- 
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA
From: Gökhan S. <gok...@gm...> - 2010年04月19日 18:36:23
On Mon, Apr 19, 2010 at 1:31 AM, Matthias Michler
<Mat...@gm...>wrote:
> On Sunday 18 April 2010 00:52:57 Gökhan Sever wrote:
> > Hello,
> >
> > Let say we have a figure created by:
> >
> > plt.plot(range(100))
> >
> > On WX backend plt.grid(1) or key "G" responds finely for turning on/off
> the
> > grid lines. However when I log-scale both axes then plt.grid(1 or 0) or
> "G"
> > doesn't respond on minor grid lines.
> >
> > Is there a way to control this behavior?
> >
> > Thanks.
>
> Hi Gökhan,
>
> I can confirm your findings and I hope my attached patch (against current
> svn)
> solves this problem. In the axes.grid the boolean 'b' was set to 'True' if
> the kwarg 'which' was suplied, because it was part of the **kwargs and so
> always b was True in the axis (e.g. ax.xaxis).
>
> Now I get a grid on the minor-ticks by calling:
>
> ax.grid(True, which="majorminor")
>
> and remove the the minortick-grid lines / all grid lines by calling
>
> ax.grid(False, which="minor")
> ax.grid(False, which="majorminor")
>
> Kind regards,
> Matthias
Works great both "majorminor" and "minormajor" works as a which keyword.
One minor thing. When I updated backend_bases.py as it doesn't function
correctly when I toggle G
 if event.key in grid_keys:
 event.inaxes.grid(which='majorminor')
 self.canvas.draw()
Could you take a look this one as well?
Thanks.
This change should go into the svn.
-- 
Gökhan
From: Darren D. <dsd...@gm...> - 2010年04月19日 18:36:12
On Mon, Apr 19, 2010 at 1:51 PM, C M <cmp...@gm...> wrote:
> On Mon, Apr 19, 2010 at 1:31 PM, Mauro Cavalcanti <mau...@gm...> wrote:
>> As I posted before, I ran across precisely these same errors when
>> upgrading my Ubuntu box and the Python interpreter. You will need to
>> install other dependencies as the installation log shows (gtk-2.0+,
>> pygtk), including its development versions.
>
> Can someone explain why I was able to have matplotlib 0.99 installed
> previously, and can easily have 0.98 installed through Synaptic/Ubuntu
> repositories, and yet have to hunt down the additional dependencies
> myself if I install from svn?
Because you have to have the development headers available in order to
*compile* the extension code in matplotlib. I tried to make clear in
my previous post that if you inspect the error messages and find
references to missing .h files, that means you need to install the
relevant development packages. In your most recent post, png.h is
missing, so you need to install libpng-dev (or whatever ubuntu calls
the development headers for the png library).
> I can't recall if I installed 0.99
> through a third party repository or how I got it, but the point is:
> is the svn version going to be different than what one gets through a
> repository?
>
> Is this need to install dependencies usually the case when installing
> from svn?
yes
> --and if so, can I suggest that this be mentioned in the
> online documentation? (perhaps it is and I didn't see it?).
The information is already available in the INSTALL file in the svn
sources, and I just added a comment which should eventually appear at
http://matplotlib.sourceforge.net/users/installing.html .
Darren
From: Michael D. <md...@st...> - 2010年04月19日 18:32:26
C M wrote:
> On Mon, Apr 19, 2010 at 1:31 PM, Mauro Cavalcanti <mau...@gm...> wrote:
> 
>> As I posted before, I ran across precisely these same errors when
>> upgrading my Ubuntu box and the Python interpreter. You will need to
>> install other dependencies as the installation log shows (gtk-2.0+,
>> pygtk), including its development versions.
>> 
>
> Can someone explain why I was able to have matplotlib 0.99 installed
> previously, and can easily have 0.98 installed through Synaptic/Ubuntu
> repositories, and yet have to hunt down the additional dependencies
> myself if I install from svn? I can't recall if I installed 0.99
> through a third party repository or how I got it, but the point is:
> is the svn version going to be different than what one gets through a
> repository?
> 
When building from source, you also need the header files (*.h files) of 
all of matplotlib's dependencies. When you install the matplotlib 
binary package (.deb file), these header files are not installed. 
Debian, Ubuntu and most other Linux distros separate the compiled binary 
libraries and header files into separate packages. The latter are 
usually named the same as the binary package but with a "-dev" suffix.
The "apt-get build-dep" command is designed specifically to install all 
of the header files required to build a particular package. Therefore 
"apt-get build-dep python-matplotlib" is a great shortcut to set up your 
machine for building matplotlib from source.
> Is this need to install dependencies usually the case when installing
> from svn?--and if so, can I suggest that this be mentioned in the
> online documentation? (perhaps it is and I didn't see it?).
> 
It sure can -- it was overlooked because this requirement is true of any 
compiled piece of software, not just matplotlib. Would you like to 
contribute a paragraph or two? I'd be happy to merge it into the docs.
Mike
-- 
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA
From: Mauro C. <mau...@gm...> - 2010年04月19日 18:05:14
2010年4月19日 C M <cmp...@gm...>:
>> And yes, distributing a packaged Python application which uses
>> Matplotlib (either for Linux or Windows) is *not* an easy and simple
>> matter. But with patience, it is possible.
>
> On Windows I've found it is close to easy once you know to include
> the matplotlib data files in your py2exe script (also, using GUI2Exe
> helps with this a great deal). What are the (basic) steps for doing
> this on Linux? I was thinking of using cx_freeze or something to
> package everything up on Linux.
With Python 2.5, I have success with bb_freeze (derived from
cx_freeze), however it is not compatible with Python 2.6. I'm right
now investigating PyInstaller (http://www.pyinstaller.org/), which
looks promising.
Hope this helps.
Best wishes,
-- 
Dr. Mauro J. Cavalcanti
P.O. Box 46521, CEP 20551-970
Rio de Janeiro, RJ, BRASIL
E-mail: mau...@gm...
Web: http://sites.google.com/site/maurobio
Linux Registered User #473524 * Ubuntu User #22717
From: David Ho <it...@uc...> - 2010年04月19日 18:03:26
Just as an illustration, I'm looking for a nice way to plot something like
this:
http://labrosa.ee.columbia.edu/matlab/sgram/
I don't necessarily need a weighting matrix to convert the Pxx array, which
is what Dan Ellis' code does; I just need to visualize the spectrogram on a
logarithmic axis.
Is there any built-in way to do this?
I'd just like to be able to call specgram(), and then call something like
yscale('log', basey=10), to change the y-axis to be logarithmic, stretching
or compressing different areas of the image appropriately. The equivalent
code would work in MATLAB. However, this doesn't seem to work with
matplotlib (I just get an empty figure).
Similarly, I couldn't get matplotlib.pyplot.semilogy() to work; I get the
warning: "Images are not supported on non-linear axes."
Does anyone have any ideas?
Thanks!
--David Ho
On Thu, Apr 15, 2010 at 12:27 PM, David Ho <it...@uc...> wrote:
> Hi all!
>
> I have a quick newbie question.
> matplotlib's specgram() by default plots a spectrogram with a linear y-axis
> (frequency).
> However, for many applications, it's better to look at a log-frequency
> spectrogram.
>
> Is there an easy way to plot a spectrogram using a logarithmic frequency
> axis?
>
> Thanks for your help!
>
> --David Ho
>
From: Jae-Joon L. <lee...@gm...> - 2010年04月19日 18:01:16
There seems no obvious way to change the padding.
You may use *set_rgrids* method which takes rpad parameter but you
need to specify the tick locations also.
Here is a simple function taken from set_rgrids method, that only
change the padding.
def update_rpads(ax, rpad):
 angle = ax._r_label1_position.to_values()[4]
 rmax = ax.get_rmax()
 ax._r_label1_position.clear().translate(angle, rpad * rmax)
 ax._r_label2_position.clear().translate(angle, -rpad * rmax)
update_rpads(ax, rpad=0.05)
Regards,
-JJ
On Tue, Apr 13, 2010 at 12:08 PM, Daniel Platz
<mai...@go...> wrote:
> Hello,
>
> I have a question concerning the label positions of x- or y-ticks. My
> problem is that I want to make a polar plot with ticklabels. To
> generate such a plot you can use the following simple example script.
>
> # #################################################
> import numpy as np
> import matplotlib.pyplot as plt
>
> r = np.linspace(0, 10, 100)
> t = np.linspace(0, 4*np.pi, 100)
>
> fig = plt.figure(1)
> fig.clf()
> ax = fig.add_subplot(1,1,1, polar=True)
> ax.plot(t, r, lw=2)
>
> plt.draw()
> plt.show()
> # ##################################################
>
> When generating a polarplot with this script one realizes that the
> r-ticklabels (y-ticklabels) end up on the gridlines. This looks looks
> kind of ugly especially for the last ticklabel ("10") which breaks the
> solid line at the outer plot boundary. So I would like to move the
> ticklabels a little bit to the right.
>
> My question is: Is there a simple trick to change the default
> ticklabelpad between the axis and the ticklabels or do I have to do
> this manually by changing the position of every single ticklabel?
>
> About a short answer I would be very glad.
>
> With kind regards,
>
> Daniel
>
> ------------------------------------------------------------------------------
> Download Intel&#174; Parallel Studio Eval
> Try the new software tools for yourself. Speed compiling, find bugs
> proactively, and fine-tune applications for parallel performance.
> See why Intel Parallel Studio got high marks during beta.
> http://p.sf.net/sfu/intel-sw-dev
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
From: Keegan C. <kc...@kc...> - 2010年04月19日 18:00:16
Hello Michael,
I have not tried using plt.figure() and plt.close(fig) but you are 
right; I should investigate it as well for completeness. I had, 
actually, purposefully avoided doing this because I read that the pyplot 
API is stateful. It keeps references to figures in the same way that 
MatLab does and these figures need to be explicitly closed (via 
plt.close). By calling Figure(...) directly I am trying to use 
matplotlib's object-oriented API and avoid pyplot's statefullness.
Something interesting and perhaps enlightening is to switch backends 
from Agg to something else (say Cairo). In the demonstration script 
that I posted you would do so like this:
#from matplotlib.backends.backend_agg import FigureCanvasAgg as FigureCanvas
from matplotlib.backends.backend_cairo import FigureCanvasCairo as 
FigureCanvas
When using the Cairo backend the memory leak disappears. In my mind, 
this indicates a memory leak when using the Agg backend that DOES NOT 
appear when using the Cairo backend.
Thanks for the advice; I will give pyplot a try and see if I get 
different behaviour.
Sincerely,
Keegan Callin
On 04/19/2010 11:28 AM, K.-Michael Aye wrote:
> Could you try to use figure() instead of Figure()? That often creates a
> mess on my side.
> Or should one use Figure() in the 'Artist's style? I am still importing
> pyplot as plt, and in that case, I have to use figure(), otherwise
> things don't work.
>
> I also had the feeling of a leak and am currently doing this without
> much 'leaking': :)
>
> fig = plt.figure()
> ax = fig.add_subplot(111)
> im = ax.imshow(nData)
> cb = plt.colorbar(im)
> ax.set_title(bname + ', ' + mode)
> fig.savefig(filename + '.equal.png')
> plt.close(fig)
>
> I think, the plt.close(fig) was quite important in my case.
> Give it a try!
> 
From: C M <cmp...@gm...> - 2010年04月19日 17:51:37
On Mon, Apr 19, 2010 at 1:31 PM, Mauro Cavalcanti <mau...@gm...> wrote:
> As I posted before, I ran across precisely these same errors when
> upgrading my Ubuntu box and the Python interpreter. You will need to
> install other dependencies as the installation log shows (gtk-2.0+,
> pygtk), including its development versions.
Can someone explain why I was able to have matplotlib 0.99 installed
previously, and can easily have 0.98 installed through Synaptic/Ubuntu
repositories, and yet have to hunt down the additional dependencies
myself if I install from svn? I can't recall if I installed 0.99
through a third party repository or how I got it, but the point is:
is the svn version going to be different than what one gets through a
repository?
Is this need to install dependencies usually the case when installing
from svn?--and if so, can I suggest that this be mentioned in the
online documentation? (perhaps it is and I didn't see it?).
> And yes, distributing a packaged Python application which uses
> Matplotlib (either for Linux or Windows) is *not* an easy and simple
> matter. But with patience, it is possible.
On Windows I've found it is close to easy once you know to include
the matplotlib data files in your py2exe script (also, using GUI2Exe
helps with this a great deal). What are the (basic) steps for doing
this on Linux? I was thinking of using cx_freeze or something to
package everything up on Linux.
Thank you,
Che
From: Jae-Joon L. <lee...@gm...> - 2010年04月19日 17:47:05
I'm not sure if the default formatter needs to be changed.
However, you may try
import matplotlib.ticker as ticker
formatter=ticker.LogFormatterMathtext()
colorbar(format=formatter)
which will render colorbar ticklabels with mathtext mode.
Regards,
-JJ
On Fri, Apr 16, 2010 at 3:56 AM, Yves Revaz <yve...@ep...> wrote:
> Dear list,
>
> I want to plot colored points using scatter, with the
> color of points corresponding to the log of the z value of the points.
>
> the corresponding scatter command is :
>
> scatter(x,y,c=z,norm=colors.LogNorm())
>
> unfortunately, then I then draw a colorbar simply calling
>
> colorbar()
>
> the fonts used for the color bar is no longer in latex mode,
> as it was if I use a lin scale in scatter(), i.e., norm=None.
>
>
> Is it a bug ?
>
> Any solution ?
>
> Thanks,
>
> yves
>
>
>
>
> --
>                         (o o)
> --------------------------------------------oOO--(_)--OOo-------
> Dr. Yves Revaz
> Laboratory of Astrophysics EPFL
> Observatoire de Sauverny   Tel : ++ 41 22 379 24 28
> 51. Ch. des Maillettes    Fax : ++ 41 22 379 22 05
> 1290 Sauverny       e-mail : Yve...@ep...
> SWITZERLAND         Web : http://www.lunix.ch/revaz/
> ----------------------------------------------------------------
>
>
> ------------------------------------------------------------------------------
> Download Intel&#174; Parallel Studio Eval
> Try the new software tools for yourself. Speed compiling, find bugs
> proactively, and fine-tune applications for parallel performance.
> See why Intel Parallel Studio got high marks during beta.
> http://p.sf.net/sfu/intel-sw-dev
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
From: Michael D. <md...@st...> - 2010年04月19日 17:45:55
On Debian/Ubuntu-like systems with apt-get, you can get all of the 
development headers required for matplotlib in one fell swoop with:
 sudo apt-get build-dep python-matplotlib
Mike
Mauro Cavalcanti wrote:
> As I posted before, I ran across precisely these same errors when
> upgrading my Ubuntu box and the Python interpreter. You will need to
> install other dependencies as the installation log shows (gtk-2.0+,
> pygtk), including its development versions.
>
> And yes, distributing a packaged Python application which uses
> Matplotlib (either for Linux or Windows) is *not* an easy and simple
> matter. But with patience, it is possible.
>
> Best wishes,
>
>
> 2010年4月19日 C M <cmp...@gm...>:
> 
>> ---------- Forwarded message ----------
>> From: C M <cmp...@gm...>
>> Date: Mon, Apr 19, 2010 at 1:02 PM
>> Subject: Re: [Matplotlib-users] install from svn on Linux not working for me
>> To: Darren Dale <dsd...@gm...>
>>
>>
>> On Mon, Apr 19, 2010 at 8:02 AM, Darren Dale <dsd...@gm...> wrote:
>> 
>>> On Mon, Apr 19, 2010 at 4:30 AM, LUK ShunTim <luk...@gm...> wrote:
>>> 
>>>> On 04/19/2010 01:52 PM, C M wrote:
>>>> 
>>>>> My goal is to just get the lastest svn version of matplotlib, or, if
>>>>> not that, just the 0.99 version, up and working on my Linux (Intrepid
>>>>> Ibex) computer. I checked it matplotlib out from svn fine, and then,
>>>>> as per the webpage, did:
>>>>>
>>>>> 
>>>>>> cd matplotlib
>>>>>> python setup.py install
>>>>>> 
>>>>> and that resulted in a very large amount of errors. I'll post them at
>>>>> the bottom of this message, since there are many lines.
>>>>>
>>>>> I previously had 0.98.x installed, via the Ubuntu repositories, but I
>>>>> have uninstalled it. My version is:
>>>>> Linux ubuntu 2.6.27-7-generic #1 SMP Fri Oct 24 06:40:41 UTC 2008
>>>>> x86_64 GNU/Linux
>>>>>
>>>>> Any help is appreciated. Thank you,
>>>>> Che
>>>>>
>>>>> Errors (starting from a few lines before):
>>>>>
>>>>> creating build/temp.linux-x86_64-2.5/src
>>>>> creating build/temp.linux-x86_64-2.5/CXX
>>>>> gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall
>>>>> -Wstrict-prototypes -fPIC -DPY_ARRAY_UNIQUE_SYMBOL=MPL_ARRAY_API
>>>>> -DPYCXX_ISO_CPP_LIB=1
>>>>> -I/usr/lib/python2.5/site-packages/numpy/core/include
>>>>> -I/usr/local/include -I/usr/include -I.
>>>>> -I/usr/lib/python2.5/site-packages/numpy/core/include/freetype2
>>>>> -I/usr/local/include/freetype2 -I/usr/include/freetype2 -I./freetype2
>>>>> -I/usr/include/python2.5 -c src/ft2font.cpp -o
>>>>> build/temp.linux-x86_64-2.5/src/ft2font.o
>>>>> cc1plus: warning: command line option "-Wstrict-prototypes" is valid
>>>>> for Ada/C/ObjC but not for C++
>>>>> In file included from ./CXX/Extensions.hxx:37,
>>>>> from src/ft2font.h:4,
>>>>> from src/ft2font.cpp:1:
>>>>> ./CXX/WrapPython.h:58:20: error: Python.h: No such file or directory
>>>>> 
>>>> You seem not to have the development package of python installed.
>>>> Try "sudo apt-get install python-dev".
>>>> 
>>> It looks like you are need to install libfreetype6-dev. Any time you
>>> see missing .h files in your output, it means you need to install the
>>> development headers for that package.
>>>
>>> Darren
>>> 
>> Thanks, but after installing libfreetype6-dev, I tried to install
>> matplotlib again and still get a lot of errors. Listed below.
>>
>> Che
>>
>> Ouput of install:
>>
>> basedirlist is: ['/usr/local', '/usr']
>> ============================================================================
>> BUILDING MATPLOTLIB
>> matplotlib: 1.0.svn
>> python: 2.5.2 (r252:60911, Jan 20 2010, 23:33:04) [GCC
>> 4.3.2]
>> platform: linux2
>>
>> REQUIRED DEPENDENCIES
>> numpy: 1.1.1
>> freetype2: 9.18.3
>>
>> OPTIONAL BACKEND DEPENDENCIES
>> libpng: found, but unknown version (no pkg-config)
>> * Could not find 'libpng' headers in any of
>> * '/usr/local/include', '/usr/include', '.'
>> Tkinter: no
>> * TKAgg requires Tkinter
>> wxPython: 2.8.10.1
>> * WxAgg extension not required for wxPython >= 2.8
>> pkg-config: looking for pygtk-2.0 gtk+-2.0
>> * Package pygtk-2.0 was not found in the pkg-config
>> * search path. Perhaps you should add the directory
>> * containing `pygtk-2.0.pc' to the PKG_CONFIG_PATH
>> * environment variable No package 'pygtk-2.0' found
>> * Package gtk+-2.0 was not found in the pkg-config
>> * search path. Perhaps you should add the directory
>> * containing `gtk+-2.0.pc' to the PKG_CONFIG_PATH
>> * environment variable No package 'gtk+-2.0' found
>> * You may need to install 'dev' package(s) to
>> * provide header files.
>> Gtk+: no
>> * Could not find Gtk+ headers in any of
>> * '/usr/local/include', '/usr/include', '.'
>> Mac OS X native: no
>> Qt: no
>> Qt4: no
>> Cairo: 1.4.12
>>
>> OPTIONAL DATE/TIMEZONE DEPENDENCIES
>> datetime: present, version unknown
>> dateutil: 1.4
>> pytz: 2008b
>>
>> OPTIONAL USETEX DEPENDENCIES
>> dvipng: 1.11
>> ghostscript: 8.63
>> latex: 3.141592
>> pdftops: 3.00
>>
>> [Edit setup.cfg to suppress the above messages]
>> ============================================================================
>> pymods ['pylab']
>> packages ['matplotlib', 'matplotlib.backends',
>> 'matplotlib.backends.qt4_editor', 'matplotlib.projections',
>> 'matplotlib.testing', 'matplotlib.testing.jpl_units',
>> 'matplotlib.tests', 'mpl_toolkits', 'mpl_toolkits.mplot3d',
>> 'mpl_toolkits.axes_grid', 'mpl_toolkits.axes_grid1',
>> 'mpl_toolkits.axisartist', 'matplotlib.sphinxext',
>> 'matplotlib.numerix', 'matplotlib.numerix.mlab',
>> 'matplotlib.numerix.ma', 'matplotlib.numerix.linear_algebra',
>> 'matplotlib.numerix.random_array', 'matplotlib.numerix.fft',
>> 'matplotlib.delaunay']
>> running install
>> running build
>> running build_py
>> copying lib/matplotlib/mpl-data/matplotlibrc ->
>> build/lib.linux-x86_64-2.5/matplotlib/mpl-data
>> copying lib/matplotlib/mpl-data/matplotlib.conf ->
>> build/lib.linux-x86_64-2.5/matplotlib/mpl-data
>> running build_ext
>> building 'matplotlib.ft2font' extension
>> gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall
>> -Wstrict-prototypes -fPIC -DPY_ARRAY_UNIQUE_SYMBOL=MPL_ARRAY_API
>> -DPYCXX_ISO_CPP_LIB=1
>> -I/usr/lib/python2.5/site-packages/numpy/core/include
>> -I/usr/include/freetype2 -I/usr/local/include -I/usr/include -I.
>> -I/usr/include/python2.5 -c src/ft2font.cpp -o
>> build/temp.linux-x86_64-2.5/src/ft2font.o
>> cc1plus: warning: command line option "-Wstrict-prototypes" is valid
>> for Ada/C/ObjC but not for C++
>> gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall
>> -Wstrict-prototypes -fPIC -DPY_ARRAY_UNIQUE_SYMBOL=MPL_ARRAY_API
>> -DPYCXX_ISO_CPP_LIB=1
>> -I/usr/lib/python2.5/site-packages/numpy/core/include
>> -I/usr/include/freetype2 -I/usr/local/include -I/usr/include -I.
>> -I/usr/include/python2.5 -c src/mplutils.cpp -o
>> build/temp.linux-x86_64-2.5/src/mplutils.o
>> cc1plus: warning: command line option "-Wstrict-prototypes" is valid
>> for Ada/C/ObjC but not for C++
>> gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall
>> -Wstrict-prototypes -fPIC -DPY_ARRAY_UNIQUE_SYMBOL=MPL_ARRAY_API
>> -DPYCXX_ISO_CPP_LIB=1
>> -I/usr/lib/python2.5/site-packages/numpy/core/include
>> -I/usr/include/freetype2 -I/usr/local/include -I/usr/include -I.
>> -I/usr/include/python2.5 -c CXX/cxxsupport.cxx -o
>> build/temp.linux-x86_64-2.5/CXX/cxxsupport.o
>> cc1plus: warning: command line option "-Wstrict-prototypes" is valid
>> for Ada/C/ObjC but not for C++
>> gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall
>> -Wstrict-prototypes -fPIC -DPY_ARRAY_UNIQUE_SYMBOL=MPL_ARRAY_API
>> -DPYCXX_ISO_CPP_LIB=1
>> -I/usr/lib/python2.5/site-packages/numpy/core/include
>> -I/usr/include/freetype2 -I/usr/local/include -I/usr/include -I.
>> -I/usr/include/python2.5 -c CXX/cxx_extensions.cxx -o
>> build/temp.linux-x86_64-2.5/CXX/cxx_extensions.o
>> cc1plus: warning: command line option "-Wstrict-prototypes" is valid
>> for Ada/C/ObjC but not for C++
>> gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall
>> -Wstrict-prototypes -fPIC -DPY_ARRAY_UNIQUE_SYMBOL=MPL_ARRAY_API
>> -DPYCXX_ISO_CPP_LIB=1
>> -I/usr/lib/python2.5/site-packages/numpy/core/include
>> -I/usr/include/freetype2 -I/usr/local/include -I/usr/include -I.
>> -I/usr/include/python2.5 -c CXX/IndirectPythonInterface.cxx -o
>> build/temp.linux-x86_64-2.5/CXX/IndirectPythonInterface.o
>> cc1plus: warning: command line option "-Wstrict-prototypes" is valid
>> for Ada/C/ObjC but not for C++
>> gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall
>> -Wstrict-prototypes -fPIC -DPY_ARRAY_UNIQUE_SYMBOL=MPL_ARRAY_API
>> -DPYCXX_ISO_CPP_LIB=1
>> -I/usr/lib/python2.5/site-packages/numpy/core/include
>> -I/usr/include/freetype2 -I/usr/local/include -I/usr/include -I.
>> -I/usr/include/python2.5 -c CXX/cxxextensions.c -o
>> build/temp.linux-x86_64-2.5/CXX/cxxextensions.o
>> g++ -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions
>> build/temp.linux-x86_64-2.5/src/ft2font.o
>> build/temp.linux-x86_64-2.5/src/mplutils.o
>> build/temp.linux-x86_64-2.5/CXX/cxxsupport.o
>> build/temp.linux-x86_64-2.5/CXX/cxx_extensions.o
>> build/temp.linux-x86_64-2.5/CXX/IndirectPythonInterface.o
>> build/temp.linux-x86_64-2.5/CXX/cxxextensions.o -L/usr/local/lib
>> -lfreetype -lz -lz -lstdc++ -lm -o
>> build/lib.linux-x86_64-2.5/matplotlib/ft2font.so
>> building 'matplotlib.ttconv' extension
>> creating build/temp.linux-x86_64-2.5/ttconv
>> gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall
>> -Wstrict-prototypes -fPIC -DPY_ARRAY_UNIQUE_SYMBOL=MPL_ARRAY_API
>> -DPYCXX_ISO_CPP_LIB=1 -I/usr/local/include -I/usr/include -I.
>> -I/usr/include/python2.5 -c src/_ttconv.cpp -o
>> build/temp.linux-x86_64-2.5/src/_ttconv.o
>> cc1plus: warning: command line option "-Wstrict-prototypes" is valid
>> for Ada/C/ObjC but not for C++
>> gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall
>> -Wstrict-prototypes -fPIC -DPY_ARRAY_UNIQUE_SYMBOL=MPL_ARRAY_API
>> -DPYCXX_ISO_CPP_LIB=1 -I/usr/local/include -I/usr/include -I.
>> -I/usr/include/python2.5 -c ttconv/pprdrv_tt.cpp -o
>> build/temp.linux-x86_64-2.5/ttconv/pprdrv_tt.o
>> cc1plus: warning: command line option "-Wstrict-prototypes" is valid
>> for Ada/C/ObjC but not for C++
>> gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall
>> -Wstrict-prototypes -fPIC -DPY_ARRAY_UNIQUE_SYMBOL=MPL_ARRAY_API
>> -DPYCXX_ISO_CPP_LIB=1 -I/usr/local/include -I/usr/include -I.
>> -I/usr/include/python2.5 -c ttconv/pprdrv_tt2.cpp -o
>> build/temp.linux-x86_64-2.5/ttconv/pprdrv_tt2.o
>> cc1plus: warning: command line option "-Wstrict-prototypes" is valid
>> for Ada/C/ObjC but not for C++
>> gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall
>> -Wstrict-prototypes -fPIC -DPY_ARRAY_UNIQUE_SYMBOL=MPL_ARRAY_API
>> -DPYCXX_ISO_CPP_LIB=1 -I/usr/local/include -I/usr/include -I.
>> -I/usr/include/python2.5 -c ttconv/ttutil.cpp -o
>> build/temp.linux-x86_64-2.5/ttconv/ttutil.o
>> cc1plus: warning: command line option "-Wstrict-prototypes" is valid
>> for Ada/C/ObjC but not for C++
>> g++ -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions
>> build/temp.linux-x86_64-2.5/src/_ttconv.o
>> build/temp.linux-x86_64-2.5/ttconv/pprdrv_tt.o
>> build/temp.linux-x86_64-2.5/ttconv/pprdrv_tt2.o
>> build/temp.linux-x86_64-2.5/ttconv/ttutil.o -L/usr/local/lib -o
>> build/lib.linux-x86_64-2.5/matplotlib/ttconv.so
>> building 'matplotlib._cntr' extension
>> gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall
>> -Wstrict-prototypes -fPIC -DPY_ARRAY_UNIQUE_SYMBOL=MPL_ARRAY_API
>> -DPYCXX_ISO_CPP_LIB=1
>> -I/usr/lib/python2.5/site-packages/numpy/core/include
>> -I/usr/local/include -I/usr/include -I. -I/usr/include/python2.5 -c
>> src/cntr.c -o build/temp.linux-x86_64-2.5/src/cntr.o
>> gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions
>> build/temp.linux-x86_64-2.5/src/cntr.o -L/usr/local/lib -o
>> build/lib.linux-x86_64-2.5/matplotlib/_cntr.so
>> building 'matplotlib._delaunay' extension
>> creating build/temp.linux-x86_64-2.5/lib
>> creating build/temp.linux-x86_64-2.5/lib/matplotlib
>> creating build/temp.linux-x86_64-2.5/lib/matplotlib/delaunay
>> gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall
>> -Wstrict-prototypes -fPIC -DPY_ARRAY_UNIQUE_SYMBOL=MPL_ARRAY_API
>> -DPYCXX_ISO_CPP_LIB=1
>> -I/usr/lib/python2.5/site-packages/numpy/core/include
>> -I/usr/local/include -I/usr/include -I. -I/usr/include/python2.5 -c
>> lib/matplotlib/delaunay/_delaunay.cpp -o
>> build/temp.linux-x86_64-2.5/lib/matplotlib/delaunay/_delaunay.o
>> cc1plus: warning: command line option "-Wstrict-prototypes" is valid
>> for Ada/C/ObjC but not for C++
>> lib/matplotlib/delaunay/_delaunay.cpp: In function ‘PyObject*
>> nn_interpolate_unstructured_method(PyObject*, PyObject*)’:
>> lib/matplotlib/delaunay/_delaunay.cpp:469: warning: ‘intz’ may be used
>> uninitialized in this function
>> lib/matplotlib/delaunay/_delaunay.cpp: In function ‘PyObject*
>> nn_interpolate_method(PyObject*, PyObject*)’:
>> lib/matplotlib/delaunay/_delaunay.cpp:592: warning: ‘y’ may be used
>> uninitialized in this function
>> lib/matplotlib/delaunay/_delaunay.cpp:592: warning: ‘z’ may be used
>> uninitialized in this function
>> lib/matplotlib/delaunay/_delaunay.cpp:592: warning: ‘centers’ may be
>> used uninitialized in this function
>> lib/matplotlib/delaunay/_delaunay.cpp:592: warning: ‘nodes’ may be
>> used uninitialized in this function
>> lib/matplotlib/delaunay/_delaunay.cpp:592: warning: ‘neighbors’ may be
>> used uninitialized in this function
>> lib/matplotlib/delaunay/_delaunay.cpp: In function ‘PyObject*
>> compute_planes_method(PyObject*, PyObject*)’:
>> lib/matplotlib/delaunay/_delaunay.cpp:315: warning: ‘nodes’ may be
>> used uninitialized in this function
>> lib/matplotlib/delaunay/_delaunay.cpp:315: warning: ‘z’ may be used
>> uninitialized in this function
>> lib/matplotlib/delaunay/_delaunay.cpp:315: warning: ‘y’ may be used
>> uninitialized in this function
>> lib/matplotlib/delaunay/_delaunay.cpp: In function ‘PyObject*
>> linear_interpolate_method(PyObject*, PyObject*)’:
>> lib/matplotlib/delaunay/_delaunay.cpp:377: warning: ‘neighbors’ may be
>> used uninitialized in this function
>> lib/matplotlib/delaunay/_delaunay.cpp:377: warning: ‘nodes’ may be
>> used uninitialized in this function
>> lib/matplotlib/delaunay/_delaunay.cpp:377: warning: ‘y’ may be used
>> uninitialized in this function
>> lib/matplotlib/delaunay/_delaunay.cpp:377: warning: ‘planes’ may be
>> used uninitialized in this function
>> lib/matplotlib/delaunay/_delaunay.cpp: In function ‘PyObject*
>> getMesh(int, double*, double*)’:
>> lib/matplotlib/delaunay/_delaunay.cpp:209: warning: ‘vertices’ may be
>> used uninitialized in this function
>> lib/matplotlib/delaunay/_delaunay.cpp:116: warning: ‘tri_nbrs’ may be
>> used uninitialized in this function
>> lib/matplotlib/delaunay/_delaunay.cpp:116: warning: ‘tri_edges’ may be
>> used uninitialized in this function
>> lib/matplotlib/delaunay/_delaunay.cpp: In function ‘PyObject*
>> delaunay_method(PyObject*, PyObject*)’:
>> lib/matplotlib/delaunay/_delaunay.cpp:667: warning: ‘y’ may be used
>> uninitialized in this function
>> gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall
>> -Wstrict-prototypes -fPIC -DPY_ARRAY_UNIQUE_SYMBOL=MPL_ARRAY_API
>> -DPYCXX_ISO_CPP_LIB=1
>> -I/usr/lib/python2.5/site-packages/numpy/core/include
>> -I/usr/local/include -I/usr/include -I. -I/usr/include/python2.5 -c
>> lib/matplotlib/delaunay/VoronoiDiagramGenerator.cpp -o
>> build/temp.linux-x86_64-2.5/lib/matplotlib/delaunay/VoronoiDiagramGenerator.o
>> cc1plus: warning: command line option "-Wstrict-prototypes" is valid
>> for Ada/C/ObjC but not for C++
>> lib/matplotlib/delaunay/VoronoiDiagramGenerator.cpp: In member
>> function ‘bool VoronoiDiagramGenerator::voronoi(int)’:
>> lib/matplotlib/delaunay/VoronoiDiagramGenerator.cpp:923: warning:
>> ‘newintstar.Point::y’ may be used uninitialized in this function
>> gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall
>> -Wstrict-prototypes -fPIC -DPY_ARRAY_UNIQUE_SYMBOL=MPL_ARRAY_API
>> -DPYCXX_ISO_CPP_LIB=1
>> -I/usr/lib/python2.5/site-packages/numpy/core/include
>> -I/usr/local/include -I/usr/include -I. -I/usr/include/python2.5 -c
>> lib/matplotlib/delaunay/delaunay_utils.cpp -o
>> build/temp.linux-x86_64-2.5/lib/matplotlib/delaunay/delaunay_utils.o
>> cc1plus: warning: command line option "-Wstrict-prototypes" is valid
>> for Ada/C/ObjC but not for C++
>> gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall
>> -Wstrict-prototypes -fPIC -DPY_ARRAY_UNIQUE_SYMBOL=MPL_ARRAY_API
>> -DPYCXX_ISO_CPP_LIB=1
>> -I/usr/lib/python2.5/site-packages/numpy/core/include
>> -I/usr/local/include -I/usr/include -I. -I/usr/include/python2.5 -c
>> lib/matplotlib/delaunay/natneighbors.cpp -o
>> build/temp.linux-x86_64-2.5/lib/matplotlib/delaunay/natneighbors.o
>> cc1plus: warning: command line option "-Wstrict-prototypes" is valid
>> for Ada/C/ObjC but not for C++
>> g++ -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions
>> build/temp.linux-x86_64-2.5/lib/matplotlib/delaunay/_delaunay.o
>> build/temp.linux-x86_64-2.5/lib/matplotlib/delaunay/VoronoiDiagramGenerator.o
>> build/temp.linux-x86_64-2.5/lib/matplotlib/delaunay/delaunay_utils.o
>> build/temp.linux-x86_64-2.5/lib/matplotlib/delaunay/natneighbors.o
>> -L/usr/local/lib -o build/lib.linux-x86_64-2.5/matplotlib/_delaunay.so
>> building 'matplotlib.nxutils' extension
>> gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall
>> -Wstrict-prototypes -fPIC -DPY_ARRAY_UNIQUE_SYMBOL=MPL_ARRAY_API
>> -DPYCXX_ISO_CPP_LIB=1
>> -I/usr/lib/python2.5/site-packages/numpy/core/include
>> -I/usr/local/include -I/usr/include -I. -I/usr/include/python2.5 -c
>> src/nxutils.c -o build/temp.linux-x86_64-2.5/src/nxutils.o
>> gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions
>> build/temp.linux-x86_64-2.5/src/nxutils.o -L/usr/local/lib -o
>> build/lib.linux-x86_64-2.5/matplotlib/nxutils.so
>> building 'matplotlib._path' extension
>> creating build/temp.linux-x86_64-2.5/agg24
>> creating build/temp.linux-x86_64-2.5/agg24/src
>> gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall
>> -Wstrict-prototypes -fPIC -DPY_ARRAY_UNIQUE_SYMBOL=MPL_ARRAY_API
>> -DPYCXX_ISO_CPP_LIB=1
>> -I/usr/lib/python2.5/site-packages/numpy/core/include
>> -I/usr/local/include -I/usr/include -I.
>> -I/usr/lib/python2.5/site-packages/numpy/core/include -Isrc
>> -Iagg24/include -I. -I/usr/include/python2.5 -c
>> agg24/src/agg_curves.cpp -o
>> build/temp.linux-x86_64-2.5/agg24/src/agg_curves.o
>> cc1plus: warning: command line option "-Wstrict-prototypes" is valid
>> for Ada/C/ObjC but not for C++
>> gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall
>> -Wstrict-prototypes -fPIC -DPY_ARRAY_UNIQUE_SYMBOL=MPL_ARRAY_API
>> -DPYCXX_ISO_CPP_LIB=1
>> -I/usr/lib/python2.5/site-packages/numpy/core/include
>> -I/usr/local/include -I/usr/include -I.
>> -I/usr/lib/python2.5/site-packages/numpy/core/include -Isrc
>> -Iagg24/include -I. -I/usr/include/python2.5 -c
>> agg24/src/agg_bezier_arc.cpp -o
>> build/temp.linux-x86_64-2.5/agg24/src/agg_bezier_arc.o
>> cc1plus: warning: command line option "-Wstrict-prototypes" is valid
>> for Ada/C/ObjC but not for C++
>> gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall
>> -Wstrict-prototypes -fPIC -DPY_ARRAY_UNIQUE_SYMBOL=MPL_ARRAY_API
>> -DPYCXX_ISO_CPP_LIB=1
>> -I/usr/lib/python2.5/site-packages/numpy/core/include
>> -I/usr/local/include -I/usr/include -I.
>> -I/usr/lib/python2.5/site-packages/numpy/core/include -Isrc
>> -Iagg24/include -I. -I/usr/include/python2.5 -c
>> agg24/src/agg_trans_affine.cpp -o
>> build/temp.linux-x86_64-2.5/agg24/src/agg_trans_affine.o
>> cc1plus: warning: command line option "-Wstrict-prototypes" is valid
>> for Ada/C/ObjC but not for C++
>> gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall
>> -Wstrict-prototypes -fPIC -DPY_ARRAY_UNIQUE_SYMBOL=MPL_ARRAY_API
>> -DPYCXX_ISO_CPP_LIB=1
>> -I/usr/lib/python2.5/site-packages/numpy/core/include
>> -I/usr/local/include -I/usr/include -I.
>> -I/usr/lib/python2.5/site-packages/numpy/core/include -Isrc
>> -Iagg24/include -I. -I/usr/include/python2.5 -c
>> agg24/src/agg_vcgen_stroke.cpp -o
>> build/temp.linux-x86_64-2.5/agg24/src/agg_vcgen_stroke.o
>> cc1plus: warning: command line option "-Wstrict-prototypes" is valid
>> for Ada/C/ObjC but not for C++
>> gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall
>> -Wstrict-prototypes -fPIC -DPY_ARRAY_UNIQUE_SYMBOL=MPL_ARRAY_API
>> -DPYCXX_ISO_CPP_LIB=1
>> -I/usr/lib/python2.5/site-packages/numpy/core/include
>> -I/usr/local/include -I/usr/include -I.
>> -I/usr/lib/python2.5/site-packages/numpy/core/include -Isrc
>> -Iagg24/include -I. -I/usr/include/python2.5 -c
>> src/agg_py_transforms.cpp -o
>> build/temp.linux-x86_64-2.5/src/agg_py_transforms.o
>> cc1plus: warning: command line option "-Wstrict-prototypes" is valid
>> for Ada/C/ObjC but not for C++
>> gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall
>> -Wstrict-prototypes -fPIC -DPY_ARRAY_UNIQUE_SYMBOL=MPL_ARRAY_API
>> -DPYCXX_ISO_CPP_LIB=1
>> -I/usr/lib/python2.5/site-packages/numpy/core/include
>> -I/usr/local/include -I/usr/include -I.
>> -I/usr/lib/python2.5/site-packages/numpy/core/include -Isrc
>> -Iagg24/include -I. -I/usr/include/python2.5 -c src/path_cleanup.cpp
>> -o build/temp.linux-x86_64-2.5/src/path_cleanup.o
>> cc1plus: warning: command line option "-Wstrict-prototypes" is valid
>> for Ada/C/ObjC but not for C++
>> gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall
>> -Wstrict-prototypes -fPIC -DPY_ARRAY_UNIQUE_SYMBOL=MPL_ARRAY_API
>> -DPYCXX_ISO_CPP_LIB=1
>> -I/usr/lib/python2.5/site-packages/numpy/core/include
>> -I/usr/local/include -I/usr/include -I.
>> -I/usr/lib/python2.5/site-packages/numpy/core/include -Isrc
>> -Iagg24/include -I. -I/usr/include/python2.5 -c src/path.cpp -o
>> build/temp.linux-x86_64-2.5/src/path.o
>> cc1plus: warning: command line option "-Wstrict-prototypes" is valid
>> for Ada/C/ObjC but not for C++
>> src/path.cpp: In function ‘void clip_to_rect(PathIterator&, double,
>> double, double, double, bool, std::vector<std::vector<XY,
>> std::allocator<XY> >, std::allocator<std::vector<XY,
>> std::allocator<XY> > > >&)’:
>> src/path.cpp:821: warning: ‘y’ may be used uninitialized in this function
>> src/path.cpp:821: warning: ‘x’ may be used uninitialized in this function
>> g++ -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions
>> build/temp.linux-x86_64-2.5/agg24/src/agg_curves.o
>> build/temp.linux-x86_64-2.5/agg24/src/agg_bezier_arc.o
>> build/temp.linux-x86_64-2.5/agg24/src/agg_trans_affine.o
>> build/temp.linux-x86_64-2.5/agg24/src/agg_vcgen_stroke.o
>> build/temp.linux-x86_64-2.5/CXX/cxxsupport.o
>> build/temp.linux-x86_64-2.5/CXX/cxx_extensions.o
>> build/temp.linux-x86_64-2.5/CXX/IndirectPythonInterface.o
>> build/temp.linux-x86_64-2.5/CXX/cxxextensions.o
>> build/temp.linux-x86_64-2.5/src/agg_py_transforms.o
>> build/temp.linux-x86_64-2.5/src/path_cleanup.o
>> build/temp.linux-x86_64-2.5/src/path.o -L/usr/local/lib -lstdc++ -lm
>> -o build/lib.linux-x86_64-2.5/matplotlib/_path.so
>> building 'matplotlib.backends._backend_agg' extension
>> gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall
>> -Wstrict-prototypes -fPIC -DPY_ARRAY_UNIQUE_SYMBOL=MPL_ARRAY_API
>> -DPYCXX_ISO_CPP_LIB=1
>> -I/usr/lib/python2.5/site-packages/numpy/core/include
>> -I/usr/local/include -I/usr/include -I.
>> -I/usr/lib/python2.5/site-packages/numpy/core/include -Isrc
>> -Iagg24/include -I.
>> -I/usr/lib/python2.5/site-packages/numpy/core/include
>> -I/usr/include/freetype2 -I/usr/local/include -I/usr/include -I.
>> -I/usr/include/python2.5 -c agg24/src/agg_vcgen_dash.cpp -o
>> build/temp.linux-x86_64-2.5/agg24/src/agg_vcgen_dash.o
>> cc1plus: warning: command line option "-Wstrict-prototypes" is valid
>> for Ada/C/ObjC but not for C++
>> gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall
>> -Wstrict-prototypes -fPIC -DPY_ARRAY_UNIQUE_SYMBOL=MPL_ARRAY_API
>> -DPYCXX_ISO_CPP_LIB=1
>> -I/usr/lib/python2.5/site-packages/numpy/core/include
>> -I/usr/local/include -I/usr/include -I.
>> -I/usr/lib/python2.5/site-packages/numpy/core/include -Isrc
>> -Iagg24/include -I.
>> -I/usr/lib/python2.5/site-packages/numpy/core/include
>> -I/usr/include/freetype2 -I/usr/local/include -I/usr/include -I.
>> -I/usr/include/python2.5 -c agg24/src/agg_image_filters.cpp -o
>> build/temp.linux-x86_64-2.5/agg24/src/agg_image_filters.o
>> cc1plus: warning: command line option "-Wstrict-prototypes" is valid
>> for Ada/C/ObjC but not for C++
>> gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall
>> -Wstrict-prototypes -fPIC -DPY_ARRAY_UNIQUE_SYMBOL=MPL_ARRAY_API
>> -DPYCXX_ISO_CPP_LIB=1
>> -I/usr/lib/python2.5/site-packages/numpy/core/include
>> -I/usr/local/include -I/usr/include -I.
>> -I/usr/lib/python2.5/site-packages/numpy/core/include -Isrc
>> -Iagg24/include -I.
>> -I/usr/lib/python2.5/site-packages/numpy/core/include
>> -I/usr/include/freetype2 -I/usr/local/include -I/usr/include -I.
>> -I/usr/include/python2.5 -c src/backend_agg.cpp -o
>> build/temp.linux-x86_64-2.5/src/backend_agg.o
>> cc1plus: warning: command line option "-Wstrict-prototypes" is valid
>> for Ada/C/ObjC but not for C++
>> src/backend_agg.cpp:3:17: error: png.h: No such file or directory
>> src/backend_agg.cpp: In member function ‘Py::Object
>> RendererAgg::draw_image(const Py::Tuple&)’:
>> src/backend_agg.cpp:824: warning: ‘h’ may be used uninitialized in this function
>> src/backend_agg.cpp:824: warning: ‘w’ may be used uninitialized in this function
>> error: command 'gcc' failed with exit status 1
>>
>> ------------------------------------------------------------------------------
>> Download Intel&#174; Parallel Studio Eval
>> Try the new software tools for yourself. Speed compiling, find bugs
>> proactively, and fine-tune applications for parallel performance.
>> See why Intel Parallel Studio got high marks during beta.
>> http://p.sf.net/sfu/intel-sw-dev
>> _______________________________________________
>> 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: K.-Michael A. <kmi...@gm...> - 2010年04月19日 17:35:22
On 2010年04月16日 19:18:56 +0200, Keegan Callin said:
> Hello,
> 
> I have written a small script that, I think, demonstrates a memory leak
> in savefig. A search of the mailing list shows a thread started by Ralf
> Gommers <ral...@go...> about 
> 2009年07月01日 that seems to
> cover a very similar issue. I have appended the demonstration script at
> the end of this e-mail text.
> 
> [keegan@grizzly ~]$ python2.6
> Python 2.6.4 (r264:75706, Jan 20 2010, 12:34:05)
> [GCC 4.4.2 20091222 (Red Hat 4.4.2-20)] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
> >>> import matplotlib
> >>> matplotlib.__version__
> '0.99.1.1'
> '''
> # Import standard python modules
> import sys
> import os
> from ConfigParser import SafeConfigParser as ConfigParser
> from cStringIO import StringIO
> 
> # import numpy
> import numpy
> from numpy import zeros
> 
> # Import matplotlib
> from matplotlib.figure import Figure
> from matplotlib.backends.backend_agg import FigureCanvasAgg as FigureCanvas
> 
> 
> def build_figure(a):
> '''Returns a new figure containing array a.'''
> 
> # Create figure and setup graph
> fig = Figure()
Could you try to use figure() instead of Figure()? That often creates a 
mess on my side.
Or should one use Figure() in the 'Artist's style? I am still importing 
pyplot as plt, and in that case, I have to use figure(), otherwise 
things don't work.
I also had the feeling of a leak and am currently doing this without 
much 'leaking': :)
 fig = plt.figure()
 ax = fig.add_subplot(111)
 im = ax.imshow(nData)
 cb = plt.colorbar(im)
 ax.set_title(bname + ', ' + mode)
 fig.savefig(filename + '.equal.png')
 plt.close(fig)
I think, the plt.close(fig) was quite important in my case.
Give it a try!
Best regards,
Michael
1 message has been excluded from this view by a project administrator.

Showing results of 46

1 2 > >> (Page 1 of 2)
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.
Thanks for helping keep SourceForge clean.
X





Briefly describe the problem (required):
Upload screenshot of ad (required):
Select a file, or drag & drop file here.
Screenshot instructions:

Click URL instructions:
Right-click on the ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)

More information about our ad policies

Ad destination/click URL:

AltStyle によって変換されたページ (->オリジナル) /