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

Showing results of 33

1 2 > >> (Page 1 of 2)
From: Michael D. <md...@st...> - 2009年10月12日 21:19:21
Thanks. On further investigation, I was reminded that stixsans (or 
anything not in the BMP) doesn't work with Type 42 fonts. The way the 
PDF spec forces you to deal with them, if it's even possible, is really 
hairy. So to solve your problem you can either a) not use stixsans, or 
b) use Type 3 fonts. We should document this somewhere.
In any case, we should still fix the crash bug on narrow (e.g. Windows) 
Python builds, so the behavior of "no characters printed" is at least 
the same on all environments. We should probably add some Type 3 vs. 
Type 42 font regression tests as well.
Mike
On 10/12/2009 04:43 PM, PH...@Ge... wrote:
> Jouni,
>
> I found the error! I got bored this past weekend and changed my mathtext.fontset to 'stixsans' just to see hopw it would look -- and then forgot about it. Changing that value back to 'cm' let's my original code and pyTest.py run without errors.
>
> I really appreciate your help with this and all of the other insight I've gained from the regular contributers to this list.
>
> Many thanks,
> -paul
>
> Regardless, here's my command line output with stixsans as my mathtext.fontset:
> C:\Python25>python -i c:\gdag2009\python\pyTest.py -d pdf
> Traceback (most recent call last):
> File "c:\gdag2009\python\pyTest.py", line 12, in<module>
> pl.savefig('some_math.pdf')
> File "C:\Python25\Lib\site-packages\matplotlib\pyplot.py", line 356, in savefig
> return fig.savefig(*args, **kwargs)
> File "C:\Python25\Lib\site-packages\matplotlib\figure.py", line 1032, in savefig
> self.canvas.print_figure(*args, **kwargs)
> File "C:\Python25\Lib\site-packages\matplotlib\backends\backend_qt4agg.py", line 144, in print_figure
> FigureCanvasAgg.print_figure(self, *args, **kwargs)
> File "C:\Python25\Lib\site-packages\matplotlib\backend_bases.py", line 1476, in print_figure
> **kwargs)
> File "C:\Python25\Lib\site-packages\matplotlib\backend_bases.py", line 1334, in print_pdf
> return pdf.print_pdf(*args, **kwargs)
> File "C:\Python25\Lib\site-packages\matplotlib\backends\backend_pdf.py", line 2025, in print_pdf
> self.figure.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\figure.py", line 773, 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 1735, in draw
> 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\axis.py", line 757, in draw
> self.label.draw(renderer)
> File "C:\Python25\Lib\site-packages\matplotlib\text.py", line 565, in draw
> ismath=ismath)
> File "C:\Python25\Lib\site-packages\matplotlib\backends\backend_pdf.py", line 1516, in draw_text
> if ismath: return self.draw_mathtext(gc, x, y, s, prop, angle)
> File "C:\Python25\Lib\site-packages\matplotlib\backends\backend_pdf.py", line 1378, in draw_mathtext
> self.file.output(self.encode_string(unichr(num), fonttype), Op.show)
> ValueError: unichr() arg not in range(0x10000) (narrow Python build)
> 
>>>> from pdb import pm
>>>> pm()
>>>> 
>> c:\python25\lib\site-packages\matplotlib\backends\backend_pdf.py(1378)draw_mathtext()
>> 
> -> self.file.output(self.encode_string(unichr(num), fonttype), Op.show)
> (Pdb) p fontname, fontsize, num, symbol_name
> ('C:\\Python25\\lib\\site-packages\\matplotlib\\mpl-data\\fonts\\ttf\\STIXGeneralItalic.ttf', 7.0, 120378, 'u1D63A')
> (Pdb) p s, width, height, descent, glyphs, rects, used_characters
> ('some math: $\\tau_{y}$', 72.0, 11.0, 3.0, [(0.0, 3.40625, 'C:\\Python25\\lib\\site-packages\\matplotlib\\mpl-data\\fonts\\ttf\\V
> era.ttf', 10.0, 115, 's'), (5.2099609375, 3.40625, 'C:\\Python25\\lib\\site-packages\\matplotlib\\mpl-data\\fonts\\ttf\\Vera.ttf',
> 10.0, 111, 'o'), (11.328125, 3.40625, 'C:\\Python25\\lib\\site-packages\\matplotlib\\mpl-data\\fonts\\ttf\\Vera.ttf', 10.0, 109,
> 'm'), (21.0693359375, 3.40625, 'C:\\Python25\\lib\\site-packages\\matplotlib\\mpl-data\\fonts\\ttf\\Vera.ttf', 10.0, 101, 'e'), (2
> 7.2216796875, 3.40625, 'C:\\Python25\\lib\\site-packages\\matplotlib\\mpl-data\\fonts\\ttf\\Vera.ttf', 10.0, 32, 'space'), (30.400
> 390625, 3.40625, 'C:\\Python25\\lib\\site-packages\\matplotlib\\mpl-data\\fonts\\ttf\\Vera.ttf', 10.0, 109, 'm'), (40.1416015625,
> 3.40625, 'C:\\Python25\\lib\\site-packages\\matplotlib\\mpl-data\\fonts\\ttf\\Vera.ttf', 10.0, 97, 'a'), (46.26953125, 3.40625, 'C
> :\\Python25\\lib\\site-packages\\matplotlib\\mpl-data\\fonts\\ttf\\Vera.ttf', 10.0, 116, 't'), (50.1904296875, 3.40625, 'C:\\Pytho
> n25\\lib\\site-packages\\matplotlib\\mpl-data\\fonts\\ttf\\Vera.ttf', 10.0, 104, 'h'), (56.5283203125, 3.40625, 'C:\\Python25\\lib
> \\site-packages\\matplotlib\\mpl-data\\fonts\\ttf\\Vera.ttf', 10.0, 58, 'colon'), (59.8974609375, 3.40625, 'C:\\Python25\\lib\\sit
> e-packages\\matplotlib\\mpl-data\\fonts\\ttf\\Vera.ttf', 10.0, 32, 'space'), (63.076171875, 3.40625, 'C:\\Python25\\lib\\site-pack
> ages\\matplotlib\\mpl-data\\fonts\\ttf\\STIXNonUniIta.ttf', 10.0, 57835, 'uniE1EB'), (67.75616455078125, 2.046875, 'C:\\Python25\\
> lib\\site-packages\\matplotlib\\mpl-data\\fonts\\ttf\\STIXGeneralItalic.ttf', 7.0, 120378, 'u1D63A')], [], {'C:\\Python25\\lib\\si
> te-packages\\matplotlib\\mpl-data\\fonts\\ttf\\STIXGeneralItalic.ttf': ('C:\\Python25\\lib\\site-packages\\matplotlib\\mpl-data\\f
> onts\\ttf\\STIXGeneralItalic.ttf', set([120378])), 'C:\\Python25\\lib\\site-packages\\matplotlib\\mpl-data\\fonts\\ttf\\Vera.ttf':
> ('C:\\Python25\\lib\\site-packages\\matplotlib\\mpl-data\\fonts\\ttf\\Vera.ttf', set([32, 97, 101, 104, 109, 111, 115, 116, 58]))
> , 'C:\\Python25\\lib\\site-packages\\matplotlib\\mpl-data\\fonts\\ttf\\STIXNonUniIta.ttf': ('C:\\Python25\\lib\\site-packages\\mat
> plotlib\\mpl-data\\fonts\\ttf\\STIXNonUniIta.ttf', set([57835]))})
> (Pdb) p fonttype, global_fonttype
> (42, 42)
>
>
> 
>> -----Original Message-----
>> From: Jouni K. Seppänen [mailto:jk...@ik...]
>> Sent: Monday, October 12, 2009 1:18 PM
>> To: mat...@li...
>> Subject: Re: [Matplotlib-users] Errors with PDF (TeX-string) output
>> using Qt4Agg
>>
>> <PH...@Ge...> writes:
>>
>> 
>>> File "C:\Python25\Lib\site-
>>> 
>> packages\matplotlib\backends\backend_pdf.py", line 1378, in
>> draw_mathtext
>> 
>>> self.file.output(self.encode_string(unichr(num), fonttype),
>>> 
>> Op.show)
>> 
>>> ValueError: unichr() arg not in range(0x10000) (narrow Python build)
>>> 
>> Right, IPython really had mangled the traceback. That looks like the
>> mathtext parser is outputting some characters outside the Basic
>> Multilingual Plane. Could you try the following:
>>
>> python -i c:\GDAG2009\python\pyTest.py -d pdf
>>
>> Then when the error occurs, you should be at a Python prompt. Then
>> type
>> (or just copy and paste from here - be careful with the first two
>> lines,
>> since any exception will cause Python to forget the existing
>> traceback):
>>
>> from pdb import pm
>> pm()
>> p fontname, fontsize, num, symbol_name
>> p s, width, height, descent, glyphs, rects, used_characters
>> p fonttype, global_fonttype
>>
>> It might work to set pdf.fonttype to 3 in matplotlibrc, but even if it
>> helps, it would be useful to find the root of this problem.
>>
>> --
>> Jouni K. Seppänen
>> http://www.iki.fi/jks
>>
>>
>> ----------------------------------------------------------------------
>> --------
>> Come build with us! The BlackBerry(R) Developer Conference in SF, CA
>> is the only developer event you need to attend this year. Jumpstart
>> your
>> developing skills, take BlackBerry mobile applications to market and
>> stay
>> ahead of the curve. Join us from November 9 - 12, 2009. Register now!
>> http://p.sf.net/sfu/devconference
>> _______________________________________________
>> Matplotlib-users mailing list
>> Mat...@li...
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>> 
> ------------------------------------------------------------------------------
> Come build with us! The BlackBerry(R) Developer Conference in SF, CA
> is the only developer event you need to attend this year. Jumpstart your
> developing skills, take BlackBerry mobile applications to market and stay
> ahead of the curve. Join us from November 9 - 12, 2009. Register now!
> http://p.sf.net/sfu/devconference
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> 
From: <PH...@Ge...> - 2009年10月12日 21:11:25
Mike,
Thanks for the reply. I found that I had (on a whim) set my mathtext.fontset to stixsans and then forgot about it. Returning that value to cm fixes my issues. In short, I'm all squared away now. Thanks!
Paul M. Hobson 
> -----Original Message-----
> From: Michael Droettboom [mailto:md...@st...]
> Sent: Monday, October 12, 2009 1:38 PM
> To: mat...@li...
> Subject: Re: [Matplotlib-users] Errors with PDF (TeX-string) output
> using Qt4Agg
> 
> On 10/12/2009 04:17 PM, Jouni K. Seppänen wrote:
> > <PH...@Ge...> writes:
> >
> >
> >> File "C:\Python25\Lib\site-
> packages\matplotlib\backends\backend_pdf.py", line 1378, in
> draw_mathtext
> >> self.file.output(self.encode_string(unichr(num), fonttype),
> Op.show)
> >> ValueError: unichr() arg not in range(0x10000) (narrow Python
> build)
> >>
> > Right, IPython really had mangled the traceback. That looks like the
> > mathtext parser is outputting some characters outside the Basic
> > Multilingual Plane. Could you try the following:
> >
> > python -i c:\GDAG2009\python\pyTest.py -d pdf
> >
> > Then when the error occurs, you should be at a Python prompt. Then
> type
> > (or just copy and paste from here - be careful with the first two
> lines,
> > since any exception will cause Python to forget the existing
> traceback):
> >
> > from pdb import pm
> > pm()
> > p fontname, fontsize, num, symbol_name
> > p s, width, height, descent, glyphs, rects, used_characters
> > p fonttype, global_fonttype
> >
> > It might work to set pdf.fonttype to 3 in matplotlibrc, but even if
> it
> > helps, it would be useful to find the root of this problem.
> >
> >
> What is your mathtext.fontset setting? If it's stixsans, then it is
> possible that mathtext would produce codepoints outside of the BMP
> (this
> is due to the way the STIX fonts are encoded). Unfortunately, the
> standard Python builds for Windows don't support characters in this
> range.
> 
> There might actually be a work around possible in the PDF backend --
> but
> it will have to involve encoding Unicode characters without using
> Python
> unicode objects. I'm looking into a patch now.
> 
> Cheers,
> Mike
> 
> ----------------------------------------------------------------------
> --------
> Come build with us! The BlackBerry(R) Developer Conference in SF, CA
> is the only developer event you need to attend this year. Jumpstart
> your
> developing skills, take BlackBerry mobile applications to market and
> stay
> ahead of the curve. Join us from November 9 - 12, 2009. Register now!
> http://p.sf.net/sfu/devconference
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
From: Robert K. <rob...@gm...> - 2009年10月12日 20:45:46
BTW, please do not Cc: me. I am subscribed to the list and read through GMane. 
It's annoying to get list replies to my email where I don't want them.
On 2009年10月12日 15:38 PM, John Hunter wrote:
> On Mon, Oct 12, 2009 at 3:21 PM, Robert Kern<rob...@gm...> wrote:
>> On 2009年10月12日 15:16 PM, Chaitanya Krishna wrote:
>>> Hi,
>>>
>>> I solved it by installing matplotlib 0.99. But, on Mac 10.5 when I
>>> used easy_install matplotlib, it was still saying that 0.91 was the
>>> latest and I couldn't install it. Finally I had to download the egg
>>> and manually install it (easy_install --install-dir)
>>
>> I suspect that that version of easy_install has not been fixed to parse
>> Sourceforge's new download pages.
>
> Shouldn't easy_install be reading the pypi data, which points to the
> proper sf page?
>
> http://pypi.python.org/pypi/matplotlib
Yup, but the link URLs are of the form
 http://sourceforge.net/.../<foo>.egg/download
which does not obviously mean "this is the URL for <foo>.egg" unless if you know 
to remove the final /download part.
-- 
Robert Kern
"I have come to believe that the whole world is an enigma, a harmless enigma
 that is made terrible by our own mad attempt to interpret it as though it had
 an underlying truth."
 -- Umberto Eco
From: <PH...@Ge...> - 2009年10月12日 20:43:45
Jouni,
I found the error! I got bored this past weekend and changed my mathtext.fontset to 'stixsans' just to see hopw it would look -- and then forgot about it. Changing that value back to 'cm' let's my original code and pyTest.py run without errors.
I really appreciate your help with this and all of the other insight I've gained from the regular contributers to this list.
Many thanks,
-paul
Regardless, here's my command line output with stixsans as my mathtext.fontset:
C:\Python25>python -i c:\gdag2009\python\pyTest.py -d pdf
Traceback (most recent call last):
 File "c:\gdag2009\python\pyTest.py", line 12, in <module>
 pl.savefig('some_math.pdf')
 File "C:\Python25\Lib\site-packages\matplotlib\pyplot.py", line 356, in savefig
 return fig.savefig(*args, **kwargs)
 File "C:\Python25\Lib\site-packages\matplotlib\figure.py", line 1032, in savefig
 self.canvas.print_figure(*args, **kwargs)
 File "C:\Python25\Lib\site-packages\matplotlib\backends\backend_qt4agg.py", line 144, in print_figure
 FigureCanvasAgg.print_figure(self, *args, **kwargs)
 File "C:\Python25\Lib\site-packages\matplotlib\backend_bases.py", line 1476, in print_figure
 **kwargs)
 File "C:\Python25\Lib\site-packages\matplotlib\backend_bases.py", line 1334, in print_pdf
 return pdf.print_pdf(*args, **kwargs)
 File "C:\Python25\Lib\site-packages\matplotlib\backends\backend_pdf.py", line 2025, in print_pdf
 self.figure.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\figure.py", line 773, 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 1735, in draw
 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\axis.py", line 757, in draw
 self.label.draw(renderer)
 File "C:\Python25\Lib\site-packages\matplotlib\text.py", line 565, in draw
 ismath=ismath)
 File "C:\Python25\Lib\site-packages\matplotlib\backends\backend_pdf.py", line 1516, in draw_text
 if ismath: return self.draw_mathtext(gc, x, y, s, prop, angle)
 File "C:\Python25\Lib\site-packages\matplotlib\backends\backend_pdf.py", line 1378, in draw_mathtext
 self.file.output(self.encode_string(unichr(num), fonttype), Op.show)
ValueError: unichr() arg not in range(0x10000) (narrow Python build)
>>> from pdb import pm
>>> pm()
> c:\python25\lib\site-packages\matplotlib\backends\backend_pdf.py(1378)draw_mathtext()
-> self.file.output(self.encode_string(unichr(num), fonttype), Op.show)
(Pdb) p fontname, fontsize, num, symbol_name
('C:\\Python25\\lib\\site-packages\\matplotlib\\mpl-data\\fonts\\ttf\\STIXGeneralItalic.ttf', 7.0, 120378, 'u1D63A')
(Pdb) p s, width, height, descent, glyphs, rects, used_characters
('some math: $\\tau_{y}$', 72.0, 11.0, 3.0, [(0.0, 3.40625, 'C:\\Python25\\lib\\site-packages\\matplotlib\\mpl-data\\fonts\\ttf\\V
era.ttf', 10.0, 115, 's'), (5.2099609375, 3.40625, 'C:\\Python25\\lib\\site-packages\\matplotlib\\mpl-data\\fonts\\ttf\\Vera.ttf',
 10.0, 111, 'o'), (11.328125, 3.40625, 'C:\\Python25\\lib\\site-packages\\matplotlib\\mpl-data\\fonts\\ttf\\Vera.ttf', 10.0, 109,
'm'), (21.0693359375, 3.40625, 'C:\\Python25\\lib\\site-packages\\matplotlib\\mpl-data\\fonts\\ttf\\Vera.ttf', 10.0, 101, 'e'), (2
7.2216796875, 3.40625, 'C:\\Python25\\lib\\site-packages\\matplotlib\\mpl-data\\fonts\\ttf\\Vera.ttf', 10.0, 32, 'space'), (30.400
390625, 3.40625, 'C:\\Python25\\lib\\site-packages\\matplotlib\\mpl-data\\fonts\\ttf\\Vera.ttf', 10.0, 109, 'm'), (40.1416015625,
3.40625, 'C:\\Python25\\lib\\site-packages\\matplotlib\\mpl-data\\fonts\\ttf\\Vera.ttf', 10.0, 97, 'a'), (46.26953125, 3.40625, 'C
:\\Python25\\lib\\site-packages\\matplotlib\\mpl-data\\fonts\\ttf\\Vera.ttf', 10.0, 116, 't'), (50.1904296875, 3.40625, 'C:\\Pytho
n25\\lib\\site-packages\\matplotlib\\mpl-data\\fonts\\ttf\\Vera.ttf', 10.0, 104, 'h'), (56.5283203125, 3.40625, 'C:\\Python25\\lib
\\site-packages\\matplotlib\\mpl-data\\fonts\\ttf\\Vera.ttf', 10.0, 58, 'colon'), (59.8974609375, 3.40625, 'C:\\Python25\\lib\\sit
e-packages\\matplotlib\\mpl-data\\fonts\\ttf\\Vera.ttf', 10.0, 32, 'space'), (63.076171875, 3.40625, 'C:\\Python25\\lib\\site-pack
ages\\matplotlib\\mpl-data\\fonts\\ttf\\STIXNonUniIta.ttf', 10.0, 57835, 'uniE1EB'), (67.75616455078125, 2.046875, 'C:\\Python25\\
lib\\site-packages\\matplotlib\\mpl-data\\fonts\\ttf\\STIXGeneralItalic.ttf', 7.0, 120378, 'u1D63A')], [], {'C:\\Python25\\lib\\si
te-packages\\matplotlib\\mpl-data\\fonts\\ttf\\STIXGeneralItalic.ttf': ('C:\\Python25\\lib\\site-packages\\matplotlib\\mpl-data\\f
onts\\ttf\\STIXGeneralItalic.ttf', set([120378])), 'C:\\Python25\\lib\\site-packages\\matplotlib\\mpl-data\\fonts\\ttf\\Vera.ttf':
 ('C:\\Python25\\lib\\site-packages\\matplotlib\\mpl-data\\fonts\\ttf\\Vera.ttf', set([32, 97, 101, 104, 109, 111, 115, 116, 58]))
, 'C:\\Python25\\lib\\site-packages\\matplotlib\\mpl-data\\fonts\\ttf\\STIXNonUniIta.ttf': ('C:\\Python25\\lib\\site-packages\\mat
plotlib\\mpl-data\\fonts\\ttf\\STIXNonUniIta.ttf', set([57835]))})
(Pdb) p fonttype, global_fonttype
(42, 42)
> -----Original Message-----
> From: Jouni K. Seppänen [mailto:jk...@ik...]
> Sent: Monday, October 12, 2009 1:18 PM
> To: mat...@li...
> Subject: Re: [Matplotlib-users] Errors with PDF (TeX-string) output
> using Qt4Agg
> 
> <PH...@Ge...> writes:
> 
> > File "C:\Python25\Lib\site-
> packages\matplotlib\backends\backend_pdf.py", line 1378, in
> draw_mathtext
> > self.file.output(self.encode_string(unichr(num), fonttype),
> Op.show)
> > ValueError: unichr() arg not in range(0x10000) (narrow Python build)
> 
> Right, IPython really had mangled the traceback. That looks like the
> mathtext parser is outputting some characters outside the Basic
> Multilingual Plane. Could you try the following:
> 
> python -i c:\GDAG2009\python\pyTest.py -d pdf
> 
> Then when the error occurs, you should be at a Python prompt. Then
> type
> (or just copy and paste from here - be careful with the first two
> lines,
> since any exception will cause Python to forget the existing
> traceback):
> 
> from pdb import pm
> pm()
> p fontname, fontsize, num, symbol_name
> p s, width, height, descent, glyphs, rects, used_characters
> p fonttype, global_fonttype
> 
> It might work to set pdf.fonttype to 3 in matplotlibrc, but even if it
> helps, it would be useful to find the root of this problem.
> 
> --
> Jouni K. Seppänen
> http://www.iki.fi/jks
> 
> 
> ----------------------------------------------------------------------
> --------
> Come build with us! The BlackBerry(R) Developer Conference in SF, CA
> is the only developer event you need to attend this year. Jumpstart
> your
> developing skills, take BlackBerry mobile applications to market and
> stay
> ahead of the curve. Join us from November 9 - 12, 2009. Register now!
> http://p.sf.net/sfu/devconference
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
From: John H. <jd...@gm...> - 2009年10月12日 20:38:25
On Mon, Oct 12, 2009 at 3:21 PM, Robert Kern <rob...@gm...> wrote:
> On 2009年10月12日 15:16 PM, Chaitanya Krishna wrote:
>> Hi,
>>
>> I solved it by installing matplotlib 0.99. But, on Mac 10.5 when I
>> used easy_install matplotlib, it was still saying that 0.91 was the
>> latest and I couldn't install it. Finally I had to download the egg
>> and manually install it (easy_install --install-dir)
>
> I suspect that that version of easy_install has not been fixed to parse
> Sourceforge's new download pages.
Shouldn't easy_install be reading the pypi data, which points to the
proper sf page?
http://pypi.python.org/pypi/matplotlib
JDH
From: Michael D. <md...@st...> - 2009年10月12日 20:37:47
On 10/12/2009 04:17 PM, Jouni K. Seppänen wrote:
> <PH...@Ge...> writes:
>
> 
>> File "C:\Python25\Lib\site-packages\matplotlib\backends\backend_pdf.py", line 1378, in draw_mathtext
>> self.file.output(self.encode_string(unichr(num), fonttype), Op.show)
>> ValueError: unichr() arg not in range(0x10000) (narrow Python build)
>> 
> Right, IPython really had mangled the traceback. That looks like the
> mathtext parser is outputting some characters outside the Basic
> Multilingual Plane. Could you try the following:
>
> python -i c:\GDAG2009\python\pyTest.py -d pdf
>
> Then when the error occurs, you should be at a Python prompt. Then type
> (or just copy and paste from here - be careful with the first two lines,
> since any exception will cause Python to forget the existing traceback):
>
> from pdb import pm
> pm()
> p fontname, fontsize, num, symbol_name
> p s, width, height, descent, glyphs, rects, used_characters
> p fonttype, global_fonttype
>
> It might work to set pdf.fonttype to 3 in matplotlibrc, but even if it
> helps, it would be useful to find the root of this problem.
>
> 
What is your mathtext.fontset setting? If it's stixsans, then it is 
possible that mathtext would produce codepoints outside of the BMP (this 
is due to the way the STIX fonts are encoded). Unfortunately, the 
standard Python builds for Windows don't support characters in this range.
There might actually be a work around possible in the PDF backend -- but 
it will have to involve encoding Unicode characters without using Python 
unicode objects. I'm looking into a patch now.
Cheers,
Mike
From: Robert K. <rob...@gm...> - 2009年10月12日 20:21:57
On 2009年10月12日 15:16 PM, Chaitanya Krishna wrote:
> Hi,
>
> I solved it by installing matplotlib 0.99. But, on Mac 10.5 when I
> used easy_install matplotlib, it was still saying that 0.91 was the
> latest and I couldn't install it. Finally I had to download the egg
> and manually install it (easy_install --install-dir)
I suspect that that version of easy_install has not been fixed to parse 
Sourceforge's new download pages.
-- 
Robert Kern
"I have come to believe that the whole world is an enigma, a harmless enigma
 that is made terrible by our own mad attempt to interpret it as though it had
 an underlying truth."
 -- Umberto Eco
From: Jouni K. S. <jk...@ik...> - 2009年10月12日 20:18:19
<PH...@Ge...> writes:
> File "C:\Python25\Lib\site-packages\matplotlib\backends\backend_pdf.py", line 1378, in draw_mathtext
> self.file.output(self.encode_string(unichr(num), fonttype), Op.show)
> ValueError: unichr() arg not in range(0x10000) (narrow Python build)
Right, IPython really had mangled the traceback. That looks like the
mathtext parser is outputting some characters outside the Basic
Multilingual Plane. Could you try the following:
python -i c:\GDAG2009\python\pyTest.py -d pdf
Then when the error occurs, you should be at a Python prompt. Then type
(or just copy and paste from here - be careful with the first two lines,
since any exception will cause Python to forget the existing traceback):
from pdb import pm
pm()
p fontname, fontsize, num, symbol_name
p s, width, height, descent, glyphs, rects, used_characters
p fonttype, global_fonttype
It might work to set pdf.fonttype to 3 in matplotlibrc, but even if it
helps, it would be useful to find the root of this problem.
-- 
Jouni K. Seppänen
http://www.iki.fi/jks
From: Chaitanya K. <ic...@gm...> - 2009年10月12日 20:17:01
Hi,
I solved it by installing matplotlib 0.99. But, on Mac 10.5 when I
used easy_install matplotlib, it was still saying that 0.91 was the
latest and I couldn't install it. Finally I had to download the egg
and manually install it (easy_install --install-dir)
Cheers,
Chaitanya
On Mon, Oct 12, 2009 at 8:23 PM, Robert Kern <rob...@gm...> wrote:
> On 2009年10月12日 12:19 PM, Chaitanya Krishna wrote:
>> Hi all,
>>
>> numpy.__file__ gives 1.3.0
>>
>>>>> import numpy
>>>>> print numpy.__file__
>> /Library/Python/2.5/site-packages/numpy-1.3.0-py2.5-macosx-10.5-i386.egg/numpy/__init__.pyc
>
> Ah, right. I'm sorry. numpy.core.ma is not the location of that subpackage
> anymore. It is now numpy.ma. Upgrade to a more recent matplotlib.
>
> --
> Robert Kern
>
> "I have come to believe that the whole world is an enigma, a harmless enigma
> that is made terrible by our own mad attempt to interpret it as though it had
> an underlying truth."
>  -- Umberto Eco
>
>
> ------------------------------------------------------------------------------
> Come build with us! The BlackBerry(R) Developer Conference in SF, CA
> is the only developer event you need to attend this year. Jumpstart your
> developing skills, take BlackBerry mobile applications to market and stay
> ahead of the curve. Join us from November 9 - 12, 2009. Register now!
> http://p.sf.net/sfu/devconference
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
From: Eric F. <ef...@ha...> - 2009年10月12日 19:59:22
thkoe002 wrote:
> Hello,
> 
> I have the following problem. I want the axes (only the y-axis, to be exact)
> of a imshow() graph to be nonlinear. By default, the axis goes linearily
> from 0 to (number of pixels). With the [extent] keyword, I can change that
> to going linearly from (arbitrary start) to (arbitrary end). Now, I'd like
> the axis to be dependend on a (bijective) arbitrary function, for example
> y=p^2 (when p is the pixel number and y the y-axis coordinate).
> How can I achieve this?
> Thanks a lot, cheers
> 
> Thomas
See
http://matplotlib.sourceforge.net/examples/pylab_examples/image_nonuniform.html
Eric
From: Eric F. <ef...@ha...> - 2009年10月12日 19:50:42
Xavier Gnata wrote:
> ax.plot(t[s>=0],s[s>=0],"g")
> ax.plot(t[s<0],s[s<0],"r")
> 
I don't think it does what you want, though, unless you are plotting 
markers, not lines. With lines, you will have line segments 
approximately on the x-axis across the gaps. Using masked arrays avoids 
that. The gaps (masked segments) will not be stroked.
Eric
> 
> Whaou! That's what I call a nice pythonic syntax.
> 
> XAvier
> 
>> Maybe a little shorter is the where() keyword, and even that can be omitted:
>>
>> ax.plot(t[where(s>=0)],s[where(s>=0)],"g")
>> ax.plot(t[where(s<0)],s[where(s<0)],"r")
>>
>> or, shorter:
>>
>> ax.plot(t[s>=0],s[s>=0],"g")
>> ax.plot(t[s<0],s[s<0],"r")
>>
>> cheers
>>
>> Thomas
>>
>>
>>
>> Xavier Gnata-2 wrote:
>> 
>>> Hi,
>>>
>>> Imagine you have something like:
>>>
>>> from pylab import *
>>> t = arange(0.0, 2.0, 0.01)
>>> s = sin(2*pi*t)
>>> ax = subplot(111)
>>> ax.plot(t, s)
>>>
>>> That's fine but now I would like to plot the negative parts of the curve 
>>> in red and the positive one in green.
>>> Is there a nice pylab oriented way to do that? Some kind of "conditional 
>>> formating"?
>>>
>>> Xavier
>>>
>>> ------------------------------------------------------------------------------
>>> Come build with us! The BlackBerry(R) Developer Conference in SF, CA
>>> is the only developer event you need to attend this year. Jumpstart your
>>> developing skills, take BlackBerry mobile applications to market and stay 
>>> ahead of the curve. Join us from November 9 - 12, 2009. Register now!
>>> http://p.sf.net/sfu/devconference
>>> _______________________________________________
>>> Matplotlib-users mailing list
>>> Mat...@li...
>>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>>
>>>
>>> 
>> 
> 
> 
> ------------------------------------------------------------------------------
> Come build with us! The BlackBerry(R) Developer Conference in SF, CA
> is the only developer event you need to attend this year. Jumpstart your
> developing skills, take BlackBerry mobile applications to market and stay 
> ahead of the curve. Join us from November 9 - 12, 2009. Register now!
> http://p.sf.net/sfu/devconference
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
From: <PH...@Ge...> - 2009年10月12日 19:23:10
Attachments: pyTest_debug.txt
Sheesh it's been a weird day. I failed to reply to the whole list. 
Jouni, sorry about the duplciate message...
> <PH...@Ge...> writes:
> > |C:\Documents and Settings\phobson>ipython26 -pylab
>
> From: Jouni K. Seppänen [mailto:jk...@ik...] Could you try this in 
> plain Python? I'm asking because you seem to be getting an IPython 
> warning about a possibly corrupted traceback:
> 
> > ERROR: An unexpected error occurred while tokenizing input The 
> > following traceback may be corrupted or invalid The error message 
> > is: ('EOF in multi-line statement', (550, 0))
> 
> I suggest you write your commands in a script and run it with
> 
> python script.py --verbose-debug
Jouni: Thanks for the prompt reply. I did just that. Calling the script both ways (w/ and w/o the PDF backend) fails with a lot of out. This time I've included the verbose output as an attached text file. I apologize of that's a mailing list faux pas. Here's the code for the script, pyTest.py:
import pylab as pl
x = pl.arange(6)
y = x + 5
pl.plot(x,y,'ko', zorder=10)
pl.xlabel('X-label, no TeX')
pl.ylabel('Y-label. no math')
pl.savefig('no_math.png')
pl.savefig('no_math.pdf')
pl.xlabel(r'some math: $\tau_{y}$')
pl.savefig('some_math.png')
pl.savefig('some_math.pdf')
# EOF
no_math.* and some_math.png are created just fine. The error occurred trying to create some_math.pdf.
I'm really at a loss b/c I could swear I created fairly complex figures with output to PDF about a week ago and don't recall changing my Python or MPL installation.
> so that we can get a better picture of where it is going wrong.
> 
> Also, does it matter that you are using Qt4Agg? You can test this by 
> trying
Both seemed to provide the same error message, so I've only included the verbose output from C:\Python25>python c:\GDAG2009\python\pyTest.py -d pdf --verbose-debug
For grins and giggles, I went to my matplotlibrc file and commented out the lines telling MPL to use Droid fonts (even though they never gave me a problem before). That didn't change anything.
Thanks again,
-paul
From: Xavier G. <xav...@gm...> - 2009年10月12日 18:40:20
ax.plot(t[s>=0],s[s>=0],"g")
ax.plot(t[s<0],s[s<0],"r")
Whaou! That's what I call a nice pythonic syntax.
XAvier
> Maybe a little shorter is the where() keyword, and even that can be omitted:
>
> ax.plot(t[where(s>=0)],s[where(s>=0)],"g")
> ax.plot(t[where(s<0)],s[where(s<0)],"r")
>
> or, shorter:
>
> ax.plot(t[s>=0],s[s>=0],"g")
> ax.plot(t[s<0],s[s<0],"r")
>
> cheers
>
> Thomas
>
>
>
> Xavier Gnata-2 wrote:
> 
>> Hi,
>>
>> Imagine you have something like:
>>
>> from pylab import *
>> t = arange(0.0, 2.0, 0.01)
>> s = sin(2*pi*t)
>> ax = subplot(111)
>> ax.plot(t, s)
>>
>> That's fine but now I would like to plot the negative parts of the curve 
>> in red and the positive one in green.
>> Is there a nice pylab oriented way to do that? Some kind of "conditional 
>> formating"?
>>
>> Xavier
>>
>> ------------------------------------------------------------------------------
>> Come build with us! The BlackBerry(R) Developer Conference in SF, CA
>> is the only developer event you need to attend this year. Jumpstart your
>> developing skills, take BlackBerry mobile applications to market and stay 
>> ahead of the curve. Join us from November 9 - 12, 2009. Register now!
>> http://p.sf.net/sfu/devconference
>> _______________________________________________
>> Matplotlib-users mailing list
>> Mat...@li...
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>
>>
>> 
>
> 
From: Jouni K. S. <jk...@ik...> - 2009年10月12日 18:32:32
<PH...@Ge...> writes:
> |C:\Documents and Settings\phobson>ipython26 -pylab
Could you try this in plain Python? I'm asking because you seem to be
getting an IPython warning about a possibly corrupted traceback:
> ERROR: An unexpected error occurred while tokenizing input
> The following traceback may be corrupted or invalid
> The error message is: ('EOF in multi-line statement', (550, 0))
I suggest you write your commands in a script and run it with 
python script.py --verbose-debug
so that we can get a better picture of where it is going wrong.
Also, does it matter that you are using Qt4Agg? You can test this by
trying
python script.py -d pdf --verbose-debug
If that works, then the problem could be related to Qt4Agg specifically,
but if it fails, it is somewhere else.
-- 
Jouni K. Seppänen
http://www.iki.fi/jks
From: Robert K. <rob...@gm...> - 2009年10月12日 18:24:08
On 2009年10月12日 12:19 PM, Chaitanya Krishna wrote:
> Hi all,
>
> numpy.__file__ gives 1.3.0
>
>>>> import numpy
>>>> print numpy.__file__
> /Library/Python/2.5/site-packages/numpy-1.3.0-py2.5-macosx-10.5-i386.egg/numpy/__init__.pyc
Ah, right. I'm sorry. numpy.core.ma is not the location of that subpackage 
anymore. It is now numpy.ma. Upgrade to a more recent matplotlib.
-- 
Robert Kern
"I have come to believe that the whole world is an enigma, a harmless enigma
 that is made terrible by our own mad attempt to interpret it as though it had
 an underlying truth."
 -- Umberto Eco
From: <PH...@Ge...> - 2009年10月12日 17:37:14
Group,
This error occurs for me with Matplotlib 0.99.1, Python 2.5.4 and 2.6.2, while using the Qt4Agg backend on Windows XP.
Basically, savefig('aweomse_plot.pdf') barfs if I have some math text in there. 
For example:
--------------------------------------------------
|C:\Documents and Settings\phobson>ipython26 -pylab
|Python 2.6.2 (r262:71605, Apr 14 2009, 22:40:02) [MSC v.1500 32 bit (Intel)]
|Type "copyright", "credits" or "license" for more information.
|
|IPython 0.10 -- An enhanced Interactive Python.
|? -> Introduction and overview of IPython's features.
|%quickref -> Quick reference.
|help -> Python's own help system.
|object? -> Details about 'object'. ?object also works, ?? prints more
|
| Welcome to pylab, a matplotlib-based Python environment.
| For more information, type 'help(pylab)'.In [1]: x = arange(10)
|
|In [2]: y = 0.5*x**2
|
|In [3]: plot(x,y,'ko')
|Out[3]: [<matplotlib.lines.Line2D object at 0x039F3C10>]
|
|In [4]: savefig('test.png')
|
|In [5]: savefig('test.pdf')
|
|In [6]: xlabel('rSome math: $X$')
|Out[6]: <matplotlib.text.Text object at 0x03A7A350>
|
|In [7]: savefig('test.pdf')
--------------------------------------------------
Spits out a nasty error at Input Line 7. I've include it below my sig for those who might want to look at it.
I don't know much about back ends, but I feel like I've neglected to install something since the last line of the TraceBack includes "ValueError: unichr() arg not in range(0x10000) (narrow Python build)".
I have an update-version of MikTeX on this machine. Any thoughts?
Many thanks,
Paul M. Hobson 
Senior Staff Engineer
-- 
Geosyntec Consultants 
55 SW Yamhill St, Ste 200
Portland, OR 97204
Phone: (503) 222-9518
Web: www.geosyntec.com
Erros message:
########################################################
In [7]: savefig('test.pdf')
ERROR: An unexpected error occurred while tokenizing input
The following traceback may be corrupted or invalid
The error message is: ('EOF in multi-line statement', (550, 0))
ERROR: An unexpected error occurred while tokenizing input
The following traceback may be corrupted or invalid
The error message is: ('EOF in multi-line statement', (550, 0))
ERROR: An unexpected error occurred while tokenizing input
The following traceback may be corrupted or invalid
The error message is: ('EOF in multi-line statement', (550, 0))
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
C:\Documents and Settings\phobson\<ipython console> in <module>()
C:\Python26\lib\site-packages\matplotlib\pyplot.pyc in savefig(*args, **kwargs)
 354 def savefig(*args, **kwargs):
 355 fig = gcf()
--> 356 return fig.savefig(*args, **kwargs)
 357 if Figure.savefig.__doc__ is not None:
 358 savefig.__doc__ = dedent(Figure.savefig.__doc__)
C:\Python26\lib\site-packages\matplotlib\figure.pyc in savefig(self, *args, **kwargs)
 1030 patch.set_alpha(0.0)
 1031
-> 1032 self.canvas.print_figure(*args, **kwargs)
 1033
 1034 if transparent:
C:\Python26\lib\site-packages\matplotlib\backends\backend_qt4agg.pyc in print_figure(self, *args, **kwargs)
 141 self.update(l, self.renderer.height-t, w, h)
 142
 143 def print_figure(self, *args, **kwargs):
--> 144 FigureCanvasAgg.print_figure(self, *args, **kwargs)
 145 self.draw()
C:\Python26\lib\site-packages\matplotlib\backend_bases.pyc in print_figure(self, filename, dpi, facecolor, edgecolor, orientation
 format, **kwargs)
 1474 orientation=orientation,
 1475 bbox_inches_restore=_bbox_inches_restore,
-> 1476 **kwargs)
 1477 finally:
 1478 if bbox_inches and restore_bbox:
C:\Python26\lib\site-packages\matplotlib\backend_bases.pyc in print_pdf(self, *args, **kwargs)
 1332 from backends.backend_pdf import FigureCanvasPdf # lazy import
 1333 pdf = self.switch_backends(FigureCanvasPdf)
-> 1334 return pdf.print_pdf(*args, **kwargs)
 1335
 1336 def print_png(self, *args, **kwargs):
C:\Python26\lib\site-packages\matplotlib\backends\backend_pdf.pyc in print_pdf(self, filename, **kwargs)
 2023 width, height, image_dpi, RendererPdf(file, image_dpi),
 2024 bbox_inches_restore=_bbox_inches_restore)
-> 2025 self.figure.draw(renderer)
 2026 renderer.finalize()
 2027 if isinstance(filename, PdfPages): # finish off this page
C:\Python26\lib\site-packages\matplotlib\artist.pyc in draw_wrapper(artist, renderer, *kl)
 44 def draw_wrapper(artist, renderer, *kl):
 45 before(artist, renderer)
---> 46 draw(artist, renderer, *kl)
 47 after(artist, renderer)
 48
C:\Python26\lib\site-packages\matplotlib\figure.pyc in draw(self, renderer)
 771
 772 # render the axes
--> 773 for a in self.axes: a.draw(renderer)
 774
 775 # render the figure text
C:\Python26\lib\site-packages\matplotlib\artist.pyc in draw_wrapper(artist, renderer, *kl)
 44 def draw_wrapper(artist, renderer, *kl):
 45 before(artist, renderer)
---> 46 draw(artist, renderer, *kl)
 47 after(artist, renderer)
 48
C:\Python26\lib\site-packages\matplotlib\axes.pyc in draw(self, renderer, inframe)
 1733
 1734 for zorder, i, a in dsu:
-> 1735 a.draw(renderer)
 1736
 1737 renderer.close_group('axes')
C:\Python26\lib\site-packages\matplotlib\artist.pyc in draw_wrapper(artist, renderer, *kl)
 44 def draw_wrapper(artist, renderer, *kl):
 45 before(artist, renderer)
---> 46 draw(artist, renderer, *kl)
 47 after(artist, renderer)
 48
C:\Python26\lib\site-packages\matplotlib\axis.pyc in draw(self, renderer, *args, **kwargs)
 755 self._update_label_position(ticklabelBoxes, ticklabelBoxes2)
 756
--> 757 self.label.draw(renderer)
 758
 759 self._update_offset_text_position(ticklabelBoxes, ticklabelBoxes2)
C:\Python26\lib\site-packages\matplotlib\text.pyc in draw(self, renderer)
 563 renderer.draw_text(gc, x, y, clean_line,
 564 self._fontproperties, angle,
--> 565 ismath=ismath)
 566
 567 gc.restore()
C:\Python26\lib\site-packages\matplotlib\backends\backend_pdf.pyc in draw_text(self, gc, x, y, s, prop, angle, ismath)
 1514
 1515 self.check_gc(gc, gc._rgb)
-> 1516 if ismath: return self.draw_mathtext(gc, x, y, s, prop, angle)
 1517
 1518 fontsize = prop.get_size_in_points()
C:\Python26\lib\site-packages\matplotlib\backends\backend_pdf.pyc in draw_mathtext(self, gc, x, y, s, prop, angle)
 1376 Op.selectfont)
 1377 prev_font = fontname, fontsize
-> 1378 self.file.output(self.encode_string(unichr(num), fonttype), Op.show)
 1379 self.file.output(Op.end_text)
 1380
ValueError: unichr() arg not in range(0x10000) (narrow Python build)
From: Chaitanya K. <ic...@gm...> - 2009年10月12日 17:19:58
Hi all,
numpy.__file__ gives 1.3.0
>>> import numpy
>>> print numpy.__file__
/Library/Python/2.5/site-packages/numpy-1.3.0-py2.5-macosx-10.5-i386.egg/numpy/__init__.pyc
Chaitanya
On Mon, Oct 12, 2009 at 7:11 PM, Robert Kern <rob...@gm...> wrote:
> On 2009年10月12日 11:58 AM, Chaitanya Krishna wrote:
>> Hi all,
>>
>> I am on Mac OS 10.5 and numpy 1.3.0 and matplotlib 0.91.1.
>>
>> When I run a qtdemo script, it fails with
>> File "/Library/Python/2.5/site-packages/matplotlib-0.91.1-py2.5-macosx-10.5-i386.egg/matplotlib/numerix/ma/__init__.py",
>> line 16, in<module>
>>   from numpy.core.ma import *
>> ImportError: No module named ma
>>
>> Any ideas? I have a mixed up system where I have installed my own
>> version of Python 2.6 and Apple's version at 2.5. Presently I am using
>> Apple's version of Python.
>
> Apple's version of Python comes with numpy 1.0.1, before numpy.core.ma was
> introduced. It seems like your installation of numpy 1.3.0 did not override
> Apple's version.
>
> To double-check:
>
> >>> import numpy
> >>> print numpy.__file__
>
> --
> Robert Kern
>
> "I have come to believe that the whole world is an enigma, a harmless enigma
> that is made terrible by our own mad attempt to interpret it as though it had
> an underlying truth."
>  -- Umberto Eco
>
>
> ------------------------------------------------------------------------------
> Come build with us! The BlackBerry(R) Developer Conference in SF, CA
> is the only developer event you need to attend this year. Jumpstart your
> developing skills, take BlackBerry mobile applications to market and stay
> ahead of the curve. Join us from November 9 - 12, 2009. Register now!
> http://p.sf.net/sfu/devconference
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
From: Robert K. <rob...@gm...> - 2009年10月12日 17:12:26
On 2009年10月12日 11:58 AM, Chaitanya Krishna wrote:
> Hi all,
>
> I am on Mac OS 10.5 and numpy 1.3.0 and matplotlib 0.91.1.
>
> When I run a qtdemo script, it fails with
> File "/Library/Python/2.5/site-packages/matplotlib-0.91.1-py2.5-macosx-10.5-i386.egg/matplotlib/numerix/ma/__init__.py",
> line 16, in<module>
> from numpy.core.ma import *
> ImportError: No module named ma
>
> Any ideas? I have a mixed up system where I have installed my own
> version of Python 2.6 and Apple's version at 2.5. Presently I am using
> Apple's version of Python.
Apple's version of Python comes with numpy 1.0.1, before numpy.core.ma was 
introduced. It seems like your installation of numpy 1.3.0 did not override 
Apple's version.
To double-check:
 >>> import numpy
 >>> print numpy.__file__
-- 
Robert Kern
"I have come to believe that the whole world is an enigma, a harmless enigma
 that is made terrible by our own mad attempt to interpret it as though it had
 an underlying truth."
 -- Umberto Eco
From: Chaitanya K. <ic...@gm...> - 2009年10月12日 17:00:12
Hi all,
I am on Mac OS 10.5 and numpy 1.3.0 and matplotlib 0.91.1.
When I run a qtdemo script, it fails with
File "/Library/Python/2.5/site-packages/matplotlib-0.91.1-py2.5-macosx-10.5-i386.egg/matplotlib/numerix/ma/__init__.py",
line 16, in <module>
 from numpy.core.ma import *
ImportError: No module named ma
Any ideas? I have a mixed up system where I have installed my own
version of Python 2.6 and Apple's version at 2.5. Presently I am using
Apple's version of Python.
Kind regards,
Chaitanya
Diagnostics follow!!
ckande@vaayu:~/Downloads/pyqt_dataplot_demo> python-osx qt_mpl_dataplot.pyw
Traceback (most recent call last):
 File "qt_mpl_dataplot.pyw", line 18, in <module>
 from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg
as FigureCanvas
 File "/Library/Python/2.5/site-packages/matplotlib-0.91.1-py2.5-macosx-10.5-i386.egg/matplotlib/backends/backend_qt4agg.py",
line 9, in <module>
 from matplotlib.figure import Figure
 File "/Library/Python/2.5/site-packages/matplotlib-0.91.1-py2.5-macosx-10.5-i386.egg/matplotlib/figure.py",
line 10, in <module>
 from axes import Axes, Subplot, PolarSubplot, PolarAxes
 File "/Library/Python/2.5/site-packages/matplotlib-0.91.1-py2.5-macosx-10.5-i386.egg/matplotlib/axes.py",
line 6, in <module>
 import matplotlib.numerix.npyma as ma
 File "/Library/Python/2.5/site-packages/matplotlib-0.91.1-py2.5-macosx-10.5-i386.egg/matplotlib/numerix/__init__.py",
line 166, in <module>
 __import__('ma', g, l)
 File "/Library/Python/2.5/site-packages/matplotlib-0.91.1-py2.5-macosx-10.5-i386.egg/matplotlib/numerix/ma/__init__.py",
line 16, in <module>
 from numpy.core.ma import *
ImportError: No module named ma
ckande@vaayu:~> python-osx
Python 2.5.1 (r251:54863, Feb 6 2009, 19:02:12)
[GCC 4.0.1 (Apple Inc. build 5465)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy
>>> print numpy
<module 'numpy' from
'/Library/Python/2.5/site-packages/numpy-1.3.0-py2.5-macosx-10.5-i386.egg/numpy/__init__.pyc'>
>>> import numpy.core
>>> print numpy.core
<module 'numpy.core' from
'/Library/Python/2.5/site-packages/numpy-1.3.0-py2.5-macosx-10.5-i386.egg/numpy/core/__init__.pyc'>
>>> import numpy.core.ma
Traceback (most recent call last):
 File "<stdin>", line 1, in <module>
ImportError: No module named ma
>>> import matplotlib
>>> print matplotlib
<module 'matplotlib' from
'/Library/Python/2.5/site-packages/matplotlib-0.91.1-py2.5-macosx-10.5-i386.egg/matplotlib/__init__.pyc'>
From: thkoe002 <thk...@gm...> - 2009年10月12日 16:34:44
Maybe a little shorter is the where() keyword, and even that can be omitted:
ax.plot(t[where(s>=0)],s[where(s>=0)],"g")
ax.plot(t[where(s<0)],s[where(s<0)],"r")
or, shorter:
ax.plot(t[s>=0],s[s>=0],"g")
ax.plot(t[s<0],s[s<0],"r")
cheers
Thomas
Xavier Gnata-2 wrote:
> 
> Hi,
> 
> Imagine you have something like:
> 
> from pylab import *
> t = arange(0.0, 2.0, 0.01)
> s = sin(2*pi*t)
> ax = subplot(111)
> ax.plot(t, s)
> 
> That's fine but now I would like to plot the negative parts of the curve 
> in red and the positive one in green.
> Is there a nice pylab oriented way to do that? Some kind of "conditional 
> formating"?
> 
> Xavier
> 
> ------------------------------------------------------------------------------
> Come build with us! The BlackBerry(R) Developer Conference in SF, CA
> is the only developer event you need to attend this year. Jumpstart your
> developing skills, take BlackBerry mobile applications to market and stay 
> ahead of the curve. Join us from November 9 - 12, 2009. Register now!
> http://p.sf.net/sfu/devconference
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> 
> 
-- 
View this message in context: http://www.nabble.com/plot-color-as-a-function-of-values--tp25848622p25858967.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
From: thkoe002 <thk...@gm...> - 2009年10月12日 16:26:48
Hi,
following problem: Let's say I have a couple of .png images that were
produced with imshow() and the jet() (==default) colormap. The original data
was 8 bit intensity data, now the images are 24 bit with false colors /
pseudocolors.
Now, is there a (simple?) way to calculate back from those 24 bit images to
the 8 bit intensity information? Of course this can only work with bijective
colormaps and if the colormap is well known; both is the case here.
Any ideas?
Thanks in advance, cheers
Thomas
-- 
View this message in context: http://www.nabble.com/Reverse-colormapping-LUT--tp25858855p25858855.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
From: Cédrick F. <ced...@fr...> - 2009年10月12日 16:24:36
>> This script does'nt work (it causes a PyAssertion error : invalid 
>> stock id)
> If it's a PyAssertion error, it should have a traceback. Is there not 
> one?
No, this problem is not related with Matplotlib : the PyAssertion error 
occurs when creating the wx.Menu ...
Cédrick
From: Michael D. <md...@st...> - 2009年10月12日 16:09:58
Cédrick FAURY wrote:
> Thank you for responding so quickly !!
>
>> I don't think these problems are related. One is a cache of math 
>> expression images, the other is a cache of fonts.
> I know ... and i found a lot of way to reproduce the same crash...
>> I am unable to reproduce this on Matplotlib 0.98.5.3 on Linux (don't 
>> have a Windows box handy). Can you run the attached script (which is 
>> just a modification of mathtext_wx.py to generate 60 different math 
>> expressions, and let me know if that crashes for you?
> This script does'nt work (it causes a PyAssertion error : invalid 
> stock id)
If it's a PyAssertion error, it should have a traceback. Is there not one?
Mike
>
>
>
-- 
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA
From: Cédrick F. <ced...@fr...> - 2009年10月12日 15:58:55
Attachments: mathtext_wx.py
Thank you for responding so quickly !!
> I don't think these problems are related. One is a cache of math 
> expression images, the other is a cache of fonts.
I know ... and i found a lot of way to reproduce the same crash...
> I am unable to reproduce this on Matplotlib 0.98.5.3 on Linux (don't 
> have a Windows box handy). Can you run the attached script (which is 
> just a modification of mathtext_wx.py to generate 60 different math 
> expressions, and let me know if that crashes for you?
This script does'nt work (it causes a PyAssertion error : invalid stock id)
But with this more simple attached script :
For 50 bitmaps, the crash occurs after the window is closed (with the 
"cross").
For 250, the crash occurs before the apparition of the window
In the Command prompt :
Assertion failed: ob_refcnt == 0, file CXX\cxx_extensions.cxx, line 1128
This application has requested the Runtime to terminate it in an unusual 
way.
Please contact the application's support team for more information.
No more traceback ...
Cédrick
From: Ernest A. <ead...@gm...> - 2009年10月12日 15:45:32
hi,
is there a way to put a label every two o three ticks,
instead of putting it on every tick?
the following works but it's a little cumbersome:
ax.set_yticklabels([pos % 2 != 0 and '%.2f' % num or ''
 for pos, num in enumerate(ax.get_yticks())])
cheers,
Ernest
1 message has been excluded from this view by a project administrator.

Showing results of 33

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 によって変換されたページ (->オリジナル) /