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





Showing results of 331

<< < 1 .. 4 5 6 7 8 .. 14 > >> (Page 6 of 14)
Michael et al.
 The r4633 patch fixes the problem indeed. Thanks for your help!!
Brian
=20
-----Original Message-----
From: Michael Droettboom [mailto:md...@st...]=20
Sent: Tuesday, December 11, 2007 10:03 AM
To: Boonstra, Brian
Cc: mat...@li...
Subject: Re: [Matplotlib-users] Repeated calls to set_text using TeX
formatting results in RuntimeError
The patch for r4633 is pretty simple, so you could test it without
needing to check out from SVN or build your own matplotlib etc.
Open the file "font_manager.py", which should live in
"%PYTHONPATH%/Lib/site-packages/matplotlib". Around line 681, you'll
find the function:
 def __hash__(self):
 return hash(repr(self.__props))
Change it to:
 def __hash__(self):
 return hash(repr(self.__props.__dict__))
(Obviously, back up the file first...)
Then try your script again. If that doesn't work, I'll have to fire up
Windows some time to have a look -- I'm not able to reproduce this bug
on Linux.
Cheers,
Mike
Bri...@ub... wrote:
>> I believe this is a known bug with 0.90.1. Are you able to run
> 0.91.1?
>=20
>=20
> I just upgraded and checked -- the bug still exists in 0.91.1. I'm=20
> afraid I don't know whether it has been fixed by r4633 or not.
>=20
> Best,
> Brian
>=20
>=20
> Bri...@ub... wrote:
>> I'm doing a parameter fitting exercise, and plotting the progress as=20
>> I
>=20
>> do so. I have found that repeated calls to set_text() on a text=20
>> object will result in an error opening a font file iff the text uses=20
>> TeX formatting. (I am not using the experimental usetex feature).
>>
>> I speculate that matplotlib is opening the font file anew with each=20
>> call to set_text and never closing it, resulting ultimately in having
>> too many files open. Here is a brief program to reproduce this=20
>> behavior (WinXP, Py2.5, matplotlib 0.90.1):
>>
>>
>> from pylab import figure, axes, draw, ion from numpy import array,=20
>> cos, abs
>> ion()
>> fig=3Dfigure()
>> axs=3Daxes()
>> x=3Darray(range(100))/10.0
>> cosPlot=3Daxs.plot( x, cos(x)**2, 'r' ) powText =3D=20
>> axs.text(0.9,0.02,r'$\alpha=3D$',
>>
> horizontalalignment=3D'left',verticalalignment=3D'bottom',
>> transform =3D axs.transAxes)
>> draw()
>> for alpha in array(range(10,400))/100.0:
>> axs.lines[-1].set_ydata( abs(cos(x))**alpha)
>> powText.set_text(r'$\alpha=3D%.4g$'%alpha)
>> print alpha
>> draw()
>> =20
>>
>>
>>
>>
>> Traceback (most recent call last):
>> File "delme.py", line 16, in <module>
>> File
>> "C:\Python25\Lib\site-packages\matplotlib-0.90.1-py2.5-win32.egg\matp
>> l
>> otlib\pylab.py",
>> line 754, in draw
>> File
>> "C:\Python25\Lib\site-packages\matplotlib-0.90.1-py2.5-win32.egg\matp
>> l
>> otlib\backends\backend_tkagg.py",
>> line 154, in draw
>>
>> File
>> "C:\Python25\Lib\site-packages\matplotlib-0.90.1-py2.5-win32.egg\matp
>> l
>> otlib\backends\backend_agg.py",
>> line 392, in draw
>>
>> File
>> "C:\Python25\Lib\site-packages\matplotlib-0.90.1-py2.5-win32.egg\matp
>> l
>> otlib\figure.py",
>> line 601, in draw
>> File
>> "C:\Python25\Lib\site-packages\matplotlib-0.90.1-py2.5-win32.egg\matp
>> l
>> otlib\axes.py",
>> line 1286, in draw
>> File
>> "C:\Python25\Lib\site-packages\matplotlib-0.90.1-py2.5-win32.egg\matp
>> l
>> otlib\text.py",
>> line 410, in draw
>> File
>> "C:\Python25\Lib\site-packages\matplotlib-0.90.1-py2.5-win32.egg\matp
>> l
>> otlib\text.py",
>> line 255, in _get_layout
>> File
>> "C:\Python25\Lib\site-packages\matplotlib-0.90.1-py2.5-win32.egg\matp
>> l
>> otlib\backends\backend_agg.py",
>> line 246, in get_text_width_height
>>
>> File
>> "C:\Python25\Lib\site-packages\matplotlib-0.90.1-py2.5-win32.egg\matp
>> l
>> otlib\mathtext.py",
>> line 1569, in __call__
>> File
>> "C:\Python25\Lib\site-packages\matplotlib-0.90.1-py2.5-win32.egg\matp
>> l
>> otlib\mathtext.py",
>> line 578, in __init__
>> RuntimeError: Could not open facefile=20
>> c:\Python25\lib\site-packages\matplotlib-0.90.1-py2.5-win32.egg\matpl
>> o
>> tlib\mpl-data\fonts\ttf\cmtt10.ttf;
>> Cannot_Open_Resource
>>
>>
>> ---------------------------------------------------------------------
>> -
>> --
>>
>> ---------------------------------------------------------------------
>> -
>> ---
>> SF.Net email is sponsored by:=20
>> Check out the new SourceForge.net Marketplace.
>> It's the best place to buy or sell services for just about anything=20
>> Open Source.
>> http://sourceforge.net/services/buy/index.php
>>
>>
>> ---------------------------------------------------------------------
>> -
>> --
>>
>> _______________________________________________
>> Matplotlib-users mailing list
>> Mat...@li...
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>=20
> --
> Michael Droettboom
> Science Software Branch
> Operations and Engineering Division
> Space Telescope Science Institute
> Operated by AURA for NASA
>=20
> This message contains confidential information and is intended only=20
> for the individual named. If you are not the named addressee you=20
> should not disseminate, distribute or copy this e-mail. Please notify
> the sender immediately by e-mail if you have received this e-mail by=20
> mistake and delete this e-mail from your system and destroy any copies
> thereof.
>=20
> E-mail transmission cannot be guaranteed to be secure or error-free as
> information could be intercepted, corrupted, lost, destroyed, arrive=20
> late or incomplete, or contain viruses. The sender therefore does not
> accept liability for any errors or omissions in the contents of this=20
> message which arise as a result of e-mail transmission. If=20
> verification is required please request a hard-copy version. This=20
> message is provided for informational purposes and should not be=20
> construed as a solicitation or offer to buy or sell any securities or=20
> related financial instruments.
>=20
>=20
>=20
> ----------------------------------------------------------------------
> ---
> SF.Net email is sponsored by:=20
> Check out the new SourceForge.net Marketplace.
> It's the best place to buy or sell services for just about anything=20
> Open Source.
> http://sourceforge.net/services/buy/index.php
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
--
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA
This message contains confidential information and is intended only
for the individual named. If you are not the named addressee you
should not disseminate, distribute or copy this e-mail. Please
notify the sender immediately by e-mail if you have received this
e-mail by mistake and delete this e-mail from your system and destroy 
any copies thereof.
E-mail transmission cannot be guaranteed to be secure or error-free
as information could be intercepted, corrupted, lost, destroyed,
arrive late or incomplete, or contain viruses. The sender therefore
does not accept liability for any errors or omissions in the contents
of this message which arise as a result of e-mail transmission. If
verification is required please request a hard-copy version. This
message is provided for informational purposes and should not be
construed as a solicitation or offer to buy or sell any securities or
related financial instruments.
The patch for r4633 is pretty simple, so you could test it without 
needing to check out from SVN or build your own matplotlib etc.
Open the file "font_manager.py", which should live in 
"%PYTHONPATH%/Lib/site-packages/matplotlib". Around line 681, you'll 
find the function:
 def __hash__(self):
 return hash(repr(self.__props))
Change it to:
 def __hash__(self):
 return hash(repr(self.__props.__dict__))
(Obviously, back up the file first...)
Then try your script again. If that doesn't work, I'll have to fire up 
Windows some time to have a look -- I'm not able to reproduce this bug 
on Linux.
Cheers,
Mike
Bri...@ub... wrote:
>> I believe this is a known bug with 0.90.1. Are you able to run
> 0.91.1?
> 
> 
> I just upgraded and checked -- the bug still exists in 0.91.1. I'm
> afraid I don't know whether it has been fixed by r4633 or not.
> 
> Best,
> Brian 
> 
> 
> Bri...@ub... wrote:
>> I'm doing a parameter fitting exercise, and plotting the progress as I
> 
>> do so. I have found that repeated calls to set_text() on a text 
>> object will result in an error opening a font file iff the text uses 
>> TeX formatting. (I am not using the experimental usetex feature).
>>
>> I speculate that matplotlib is opening the font file anew with each 
>> call to set_text and never closing it, resulting ultimately in having 
>> too many files open. Here is a brief program to reproduce this 
>> behavior (WinXP, Py2.5, matplotlib 0.90.1):
>>
>>
>> from pylab import figure, axes, draw, ion from numpy import array, 
>> cos, abs
>> ion()
>> fig=figure()
>> axs=axes()
>> x=array(range(100))/10.0
>> cosPlot=axs.plot( x, cos(x)**2, 'r' )
>> powText = axs.text(0.9,0.02,r'$\alpha=$',
>>
> horizontalalignment='left',verticalalignment='bottom',
>> transform = axs.transAxes)
>> draw()
>> for alpha in array(range(10,400))/100.0:
>> axs.lines[-1].set_ydata( abs(cos(x))**alpha)
>> powText.set_text(r'$\alpha=%.4g$'%alpha)
>> print alpha
>> draw()
>> 
>>
>>
>>
>>
>> Traceback (most recent call last):
>> File "delme.py", line 16, in <module>
>> File
>> "C:\Python25\Lib\site-packages\matplotlib-0.90.1-py2.5-win32.egg\matpl
>> otlib\pylab.py",
>> line 754, in draw
>> File
>> "C:\Python25\Lib\site-packages\matplotlib-0.90.1-py2.5-win32.egg\matpl
>> otlib\backends\backend_tkagg.py",
>> line 154, in draw
>>
>> File
>> "C:\Python25\Lib\site-packages\matplotlib-0.90.1-py2.5-win32.egg\matpl
>> otlib\backends\backend_agg.py",
>> line 392, in draw
>>
>> File
>> "C:\Python25\Lib\site-packages\matplotlib-0.90.1-py2.5-win32.egg\matpl
>> otlib\figure.py",
>> line 601, in draw
>> File
>> "C:\Python25\Lib\site-packages\matplotlib-0.90.1-py2.5-win32.egg\matpl
>> otlib\axes.py",
>> line 1286, in draw
>> File
>> "C:\Python25\Lib\site-packages\matplotlib-0.90.1-py2.5-win32.egg\matpl
>> otlib\text.py",
>> line 410, in draw
>> File
>> "C:\Python25\Lib\site-packages\matplotlib-0.90.1-py2.5-win32.egg\matpl
>> otlib\text.py",
>> line 255, in _get_layout
>> File
>> "C:\Python25\Lib\site-packages\matplotlib-0.90.1-py2.5-win32.egg\matpl
>> otlib\backends\backend_agg.py",
>> line 246, in get_text_width_height
>>
>> File
>> "C:\Python25\Lib\site-packages\matplotlib-0.90.1-py2.5-win32.egg\matpl
>> otlib\mathtext.py",
>> line 1569, in __call__
>> File
>> "C:\Python25\Lib\site-packages\matplotlib-0.90.1-py2.5-win32.egg\matpl
>> otlib\mathtext.py",
>> line 578, in __init__
>> RuntimeError: Could not open facefile 
>> c:\Python25\lib\site-packages\matplotlib-0.90.1-py2.5-win32.egg\matplo
>> tlib\mpl-data\fonts\ttf\cmtt10.ttf;
>> Cannot_Open_Resource
>>
>>
>> ----------------------------------------------------------------------
>> --
>>
>> ----------------------------------------------------------------------
>> ---
>> SF.Net email is sponsored by: 
>> Check out the new SourceForge.net Marketplace.
>> It's the best place to buy or sell services for just about anything 
>> Open Source.
>> http://sourceforge.net/services/buy/index.php
>>
>>
>> ----------------------------------------------------------------------
>> --
>>
>> _______________________________________________
>> Matplotlib-users mailing list
>> Mat...@li...
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> 
> --
> Michael Droettboom
> Science Software Branch
> Operations and Engineering Division
> Space Telescope Science Institute
> Operated by AURA for NASA
> 
> This message contains confidential information and is intended only
> for the individual named. If you are not the named addressee you
> should not disseminate, distribute or copy this e-mail. Please
> notify the sender immediately by e-mail if you have received this
> e-mail by mistake and delete this e-mail from your system and destroy 
> any copies thereof.
> 
> E-mail transmission cannot be guaranteed to be secure or error-free
> as information could be intercepted, corrupted, lost, destroyed,
> arrive late or incomplete, or contain viruses. The sender therefore
> does not accept liability for any errors or omissions in the contents
> of this message which arise as a result of e-mail transmission. If
> verification is required please request a hard-copy version. This
> message is provided for informational purposes and should not be
> construed as a solicitation or offer to buy or sell any securities or
> related financial instruments.
> 
> 
> 
> -------------------------------------------------------------------------
> SF.Net email is sponsored by: 
> Check out the new SourceForge.net Marketplace.
> It's the best place to buy or sell services for
> just about anything Open Source.
> http://sourceforge.net/services/buy/index.php
> _______________________________________________
> 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
> I believe this is a known bug with 0.90.1. Are you able to run
0.91.1?
I just upgraded and checked -- the bug still exists in 0.91.1. I'm
afraid I don't know whether it has been fixed by r4633 or not.
Best,
 Brian=20
Bri...@ub... wrote:
> I'm doing a parameter fitting exercise, and plotting the progress as I
> do so. I have found that repeated calls to set_text() on a text=20
> object will result in an error opening a font file iff the text uses=20
> TeX formatting. (I am not using the experimental usetex feature).
>=20
> I speculate that matplotlib is opening the font file anew with each=20
> call to set_text and never closing it, resulting ultimately in having=20
> too many files open. Here is a brief program to reproduce this=20
> behavior (WinXP, Py2.5, matplotlib 0.90.1):
>=20
>=20
> from pylab import figure, axes, draw, ion from numpy import array,=20
> cos, abs
> ion()
> fig=3Dfigure()
> axs=3Daxes()
> x=3Darray(range(100))/10.0
> cosPlot=3Daxs.plot( x, cos(x)**2, 'r' )
> powText =3D axs.text(0.9,0.02,r'$\alpha=3D$',
>
horizontalalignment=3D'left',verticalalignment=3D'bottom',
> transform =3D axs.transAxes)
> draw()
> for alpha in array(range(10,400))/100.0:
> axs.lines[-1].set_ydata( abs(cos(x))**alpha)
> powText.set_text(r'$\alpha=3D%.4g$'%alpha)
> print alpha
> draw()
> =20
>=20
>=20
>=20
>=20
> Traceback (most recent call last):
> File "delme.py", line 16, in <module>
> File
> "C:\Python25\Lib\site-packages\matplotlib-0.90.1-py2.5-win32.egg\matpl
> otlib\pylab.py",
> line 754, in draw
> File
> "C:\Python25\Lib\site-packages\matplotlib-0.90.1-py2.5-win32.egg\matpl
> otlib\backends\backend_tkagg.py",
> line 154, in draw
>=20
> File
> "C:\Python25\Lib\site-packages\matplotlib-0.90.1-py2.5-win32.egg\matpl
> otlib\backends\backend_agg.py",
> line 392, in draw
>=20
> File
> "C:\Python25\Lib\site-packages\matplotlib-0.90.1-py2.5-win32.egg\matpl
> otlib\figure.py",
> line 601, in draw
> File
> "C:\Python25\Lib\site-packages\matplotlib-0.90.1-py2.5-win32.egg\matpl
> otlib\axes.py",
> line 1286, in draw
> File
> "C:\Python25\Lib\site-packages\matplotlib-0.90.1-py2.5-win32.egg\matpl
> otlib\text.py",
> line 410, in draw
> File
> "C:\Python25\Lib\site-packages\matplotlib-0.90.1-py2.5-win32.egg\matpl
> otlib\text.py",
> line 255, in _get_layout
> File
> "C:\Python25\Lib\site-packages\matplotlib-0.90.1-py2.5-win32.egg\matpl
> otlib\backends\backend_agg.py",
> line 246, in get_text_width_height
>=20
> File
> "C:\Python25\Lib\site-packages\matplotlib-0.90.1-py2.5-win32.egg\matpl
> otlib\mathtext.py",
> line 1569, in __call__
> File
> "C:\Python25\Lib\site-packages\matplotlib-0.90.1-py2.5-win32.egg\matpl
> otlib\mathtext.py",
> line 578, in __init__
> RuntimeError: Could not open facefile=20
> c:\Python25\lib\site-packages\matplotlib-0.90.1-py2.5-win32.egg\matplo
> tlib\mpl-data\fonts\ttf\cmtt10.ttf;
> Cannot_Open_Resource
>=20
>=20
> ----------------------------------------------------------------------
> --
>=20
> ----------------------------------------------------------------------
> ---
> SF.Net email is sponsored by:=20
> Check out the new SourceForge.net Marketplace.
> It's the best place to buy or sell services for just about anything=20
> Open Source.
> http://sourceforge.net/services/buy/index.php
>=20
>=20
> ----------------------------------------------------------------------
> --
>=20
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
--
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA
This message contains confidential information and is intended only
for the individual named. If you are not the named addressee you
should not disseminate, distribute or copy this e-mail. Please
notify the sender immediately by e-mail if you have received this
e-mail by mistake and delete this e-mail from your system and destroy 
any copies thereof.
E-mail transmission cannot be guaranteed to be secure or error-free
as information could be intercepted, corrupted, lost, destroyed,
arrive late or incomplete, or contain viruses. The sender therefore
does not accept liability for any errors or omissions in the contents
of this message which arise as a result of e-mail transmission. If
verification is required please request a hard-copy version. This
message is provided for informational purposes and should not be
construed as a solicitation or offer to buy or sell any securities or
related financial instruments.
This bug is that many font files were being opened than needed, but they 
were still all getting closed.
Much earlier, someone else fixed a bug where they weren't getting closed 
at all.
http://sourceforge.net/tracker/index.php?func=detail&aid=1695171&group_id=80706&atid=560720
http://sourceforge.net/tracker/index.php?func=detail&aid=1715662&group_id=80706&atid=560720
Cheers,
Mike
John Hunter wrote:
> On Dec 11, 2007 8:17 AM, Michael Droettboom <md...@st...> wrote:
>> I believe this is a known bug with 0.90.1. Are you able to run 0.91.1?
> 
> If I am reading this right, according to the svn log, you fixed this in
> 
> r4633 | mdboom | 2007年12月05日 14:28:28 -0600 (2007年12月05日) | 2 lines
> 
> Fix bug where font files were opened many more times than they need to be.
> 
> and 0.91.1 was released at r4517. So this fix may not be out until
> the 0.91.2 point release. Or were you referring to a different fix?
> 
> JDH
-- 
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA
On Dec 11, 2007 8:17 AM, Michael Droettboom <md...@st...> wrote:
> I believe this is a known bug with 0.90.1. Are you able to run 0.91.1?
If I am reading this right, according to the svn log, you fixed this in
 r4633 | mdboom | 2007年12月05日 14:28:28 -0600 (2007年12月05日) | 2 lines
 Fix bug where font files were opened many more times than they need to be.
and 0.91.1 was released at r4517. So this fix may not be out until
the 0.91.2 point release. Or were you referring to a different fix?
JDH
I believe this is a known bug with 0.90.1. Are you able to run 0.91.1?
Cheers,
Mike
Bri...@ub... wrote:
> I'm doing a parameter fitting exercise, and plotting the progress as I 
> do so. I have found that repeated calls to set_text() on a text object 
> will result in an error opening a font file iff the text uses TeX 
> formatting. (I am not using the experimental usetex feature).
> 
> I speculate that matplotlib is opening the font file anew with each call 
> to set_text and never closing it, resulting ultimately in having too 
> many files open. Here is a brief program to reproduce this behavior 
> (WinXP, Py2.5, matplotlib 0.90.1):
> 
> 
> from pylab import figure, axes, draw, ion
> from numpy import array, cos, abs
> ion()
> fig=figure()
> axs=axes()
> x=array(range(100))/10.0
> cosPlot=axs.plot( x, cos(x)**2, 'r' )
> powText = axs.text(0.9,0.02,r'$\alpha=$',
> horizontalalignment='left',verticalalignment='bottom',
> transform = axs.transAxes)
> draw()
> for alpha in array(range(10,400))/100.0:
> axs.lines[-1].set_ydata( abs(cos(x))**alpha)
> powText.set_text(r'$\alpha=%.4g$'%alpha)
> print alpha
> draw()
> 
> 
> 
> 
> 
> Traceback (most recent call last):
> File "delme.py", line 16, in <module>
> File 
> "C:\Python25\Lib\site-packages\matplotlib-0.90.1-py2.5-win32.egg\matplotlib\pylab.py", 
> line 754, in draw
> File 
> "C:\Python25\Lib\site-packages\matplotlib-0.90.1-py2.5-win32.egg\matplotlib\backends\backend_tkagg.py", 
> line 154, in draw
> 
> File 
> "C:\Python25\Lib\site-packages\matplotlib-0.90.1-py2.5-win32.egg\matplotlib\backends\backend_agg.py", 
> line 392, in draw
> 
> File 
> "C:\Python25\Lib\site-packages\matplotlib-0.90.1-py2.5-win32.egg\matplotlib\figure.py", 
> line 601, in draw
> File 
> "C:\Python25\Lib\site-packages\matplotlib-0.90.1-py2.5-win32.egg\matplotlib\axes.py", 
> line 1286, in draw
> File 
> "C:\Python25\Lib\site-packages\matplotlib-0.90.1-py2.5-win32.egg\matplotlib\text.py", 
> line 410, in draw
> File 
> "C:\Python25\Lib\site-packages\matplotlib-0.90.1-py2.5-win32.egg\matplotlib\text.py", 
> line 255, in _get_layout
> File 
> "C:\Python25\Lib\site-packages\matplotlib-0.90.1-py2.5-win32.egg\matplotlib\backends\backend_agg.py", 
> line 246, in get_text_width_height
> 
> File 
> "C:\Python25\Lib\site-packages\matplotlib-0.90.1-py2.5-win32.egg\matplotlib\mathtext.py", 
> line 1569, in __call__
> File 
> "C:\Python25\Lib\site-packages\matplotlib-0.90.1-py2.5-win32.egg\matplotlib\mathtext.py", 
> line 578, in __init__
> RuntimeError: Could not open facefile 
> c:\Python25\lib\site-packages\matplotlib-0.90.1-py2.5-win32.egg\matplotlib\mpl-data\fonts\ttf\cmtt10.ttf; 
> Cannot_Open_Resource
> 
> 
> ------------------------------------------------------------------------
> 
> -------------------------------------------------------------------------
> SF.Net email is sponsored by: 
> Check out the new SourceForge.net Marketplace.
> It's the best place to buy or sell services for
> just about anything Open Source.
> http://sourceforge.net/services/buy/index.php
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
-- 
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA
This message contains confidential information and is intended only
for the individual named. If you are not the named addressee you
should not disseminate, distribute or copy this e-mail. Please
notify the sender immediately by e-mail if you have received this
e-mail by mistake and delete this e-mail from your system and destroy 
any copies thereof.
E-mail transmission cannot be guaranteed to be secure or error-free
as information could be intercepted, corrupted, lost, destroyed,
arrive late or incomplete, or contain viruses. The sender therefore
does not accept liability for any errors or omissions in the contents
of this message which arise as a result of e-mail transmission. If
verification is required please request a hard-copy version. This
message is provided for informational purposes and should not be
construed as a solicitation or offer to buy or sell any securities or
related financial instruments.
From: John H. <jd...@gm...> - 2007年12月11日 13:16:12
On Dec 11, 2007 6:00 AM, Emmanuel <emm...@fa...> wrote:
> Hi,
>
> I've a little problem with date conversion. I have a csv file which looks
> like :
> "Data","Valor"
> "15/01/2007"," 6,700012000"
> "12/01/2007"," 6,659903000"
>
> "11/01/2007"," 6,701586000"
>
> I try to get date using function strpdate2num in load doing this :
Try stripping the double quote characters from you file.
JDH
From: Michael D. <md...@st...> - 2007年12月11日 13:14:37
You can just pass a path to savefig, e.g.:
	savefig("/home/me/test.png")
(The format is automatically determined from the extension). If you 
want to know which formats are supported by which backends, you can have 
a look at FILETYPES in the source tree here:
http://matplotlib.svn.sourceforge.net/viewvc/matplotlib/trunk/matplotlib/FILETYPES?view=markup
Many of the examples for matplotlib have savefig, but the line is 
usually commented out. Just remove the '#' and you have lots of examples.
Cheers,
Mike
Takashi Yamamoto wrote:
> Hi,
> 
> I have recently come across Matplotlib and I am very impressed with its 
> capabilities. I am new to both Matplotlib and Python, although I have 
> several years experience with C++ and a few other languages *(including 
> modelling with MatLab).
> 
> I have successfully embedded Python in a C++ application, and can run 
> python scripts from my C++ application. However, I have found displaying 
> graphs in a GUI fraught with (insurmountable?) problems and I have 
> decided to NOT use a GUI at all, but rather, to save plots as image, to 
> file (e.g. png, gif or jpeg).
> 
> Can anyone give me a simple example script that shows how I may use 
> *savefig*(), to save a plot as an image (any of the above formats), to file?
> 
> Thanks
> 
> ------------------------------------------------------------------------
> Connect to the next generation of MSN Messenger Get it now! 
> <http://imagine-msn.com/messenger/launch80/default.aspx?locale=en-us&source=wlmailtagline>
> 
> 
> ------------------------------------------------------------------------
> 
> -------------------------------------------------------------------------
> SF.Net email is sponsored by: 
> Check out the new SourceForge.net Marketplace.
> It's the best place to buy or sell services for
> just about anything Open Source.
> http://sourceforge.net/services/buy/index.php
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> 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: Emmanuel <emm...@fa...> - 2007年12月11日 12:00:41
Hi,
I've a little problem with date conversion. I have a csv file which looks
like :
"Data","Valor"
"15/01/2007"," 6,700012000"
"12/01/2007"," 6,659903000"
"11/01/2007"," 6,701586000"
I try to get date using function strpdate2num in load doing this :
from pylab import datestr2num, load
def comma_nb2float(A):
 return eval(A.replace(',','.'))
dates, valor =
load("file.csv",delimiter=',',converters={0:strpdate2num('%d/%m/%Y'),1:comma_nb2float},skiprows=1,
usecols=(0,1),unpack=True)
I got the following error message :
---------------------------------------------------------------------------
exceptions.ValueError Traceback (most recent
call last)
/home/manu/Documents/Perso/....../<ipython console>
/usr/lib/python2.4/site-packages/matplotlib/mlab.py in load(fname, comments,
delimiter, converters, skiprows, usecols, unpack)
 1353 if usecols is not None:
 1354 vals = line.split(delimiter)
-> 1355 row = [converterseq[j](vals[j]) for j in usecols]
 1356 else:
 1357 row = [converterseq[j](val) for j,val in
enumerate(line.split(delimiter))]
/usr/lib/python2.4/site-packages/matplotlib/dates.py in __call__(self, s)
 182 return value: a date2num float
 183 """
--> 184 return date2num(datetime.datetime(*time.strptime(s, self.fmt)
[:6]))
 185
 186 def datestr2num(d):
/usr/lib/python2.4/_strptime.py in strptime(data_string, format)
 291 found = format_regex.match(data_string)
 292 if not found:
--> 293 raise ValueError("time data did not match format: data=%s
fmt=%s" %
 294 (data_string, format))
 295 if len(data_string) != found.end():
ValueError: time data did not match format: data="15/01/2007" fmt=%d/%m/%Y
I didn't understood the problem, anyone can help me ?
From: Matthew A. <ma...@ph...> - 2007年12月11日 11:28:19
I'm trying to plot a circle AND flip an axis of the plot, but this leads 
to an inverted circle (diamond) being drawn. Is there any way to do this 
'neatly' (besides, for example, manually editing the axis labels or using 
a many-sided polygon to fake a circle)? Note that the circle renders 
correctly with the PS backend.... Example code to reproduce the problem:
import pylab as p
x = p.rand(17)
y = p.rand(17)
p.scatter(x,y)
p.gca().add_patch(p.Circle((0.5,0.5),0.2,fill=False))
p.axis([0.,1.,1.,0.])
p.gca().set_aspect('equal')
p.show()
Thanks for any help!
Matt
From: Thorsten.G <tig...@we...> - 2007年12月11日 08:22:27
Hello i' am an newbie in matplotlib and python!
I've installed python 2.5.1 + numpy 1.0.4 + numarray 1.5.2 but have many
problems !
I've written an easy plot script
import matplotlib
import pylab
from pylab import arange,sin,pi,plot,xlabel,ylabel,title,grid,show,axis
ymax = max([1,4,9,16,12,5,7,13,7,1,33])
ymin = min([1,-4,9,16,12,5,7,13,7,1,33])
print 'ymax = %s' % ymax
print 'ymin = %s' % ymin
plot([1,2,3,4,5,6,7,8,9,10,11], [1,4,9,16,12,5,7,13,7,1,33], 'ro')
axis([0, 15, ymin-5, ymax+5])
xlabel('time (s)')
ylabel('voltage (mV)')
title('About as simple as it gets, folks')
grid(True)
show()
--> AND i get some problems
D:\Program
Files\Python-2.5.1\Lib\site-packages\matplotlib\numerix\__init__.py:65:
DeprecationWarning: numarray use as a numerix backed for matplotlib is
deprecated
 DeprecationWarning, stacklevel=1)
Traceback (most recent call last):
 File "D:\workspace-py\GDOParser\PlotTest.py", line 12, in <module>
 plot([1,2,3,4], [1,4,9,16], 'ro')
 File "d:\Program
Files\Python-2.5.1\Lib\site-packages\matplotlib\pyplot.py", line 1775, in
plot
 b = ishold()
 File "d:\Program
Files\Python-2.5.1\Lib\site-packages\matplotlib\pyplot.py", line 340, in
ishold
 return gca().ishold()
 File "d:\Program
Files\Python-2.5.1\Lib\site-packages\matplotlib\pyplot.py", line 433, in gca
 ax = gcf().gca(**kwargs)
 File "d:\Program
Files\Python-2.5.1\Lib\site-packages\matplotlib\figure.py", line 722, in gca
 return self.add_subplot(111, **kwargs)
 File "d:\Program
Files\Python-2.5.1\Lib\site-packages\matplotlib\figure.py", line 542, in
add_subplot
 a = Subplot(self, *args, **kwargs)
 File "d:\Program Files\Python-2.5.1\Lib\site-packages\matplotlib\axes.py",
line 5561, in __init__
 self.figW, self.figH], **kwargs)
 File "d:\Program Files\Python-2.5.1\Lib\site-packages\matplotlib\axes.py",
line 507, in __init__
 self._init_axis()
 File "d:\Program Files\Python-2.5.1\Lib\site-packages\matplotlib\axes.py",
line 545, in _init_axis
 self.xaxis = maxis.XAxis(self)
 File "d:\Program Files\Python-2.5.1\Lib\site-packages\matplotlib\axis.py",
line 518, in __init__
 self.cla()
 File "d:\Program Files\Python-2.5.1\Lib\site-packages\matplotlib\axis.py",
line 553, in cla
 self.majorTicks.extend([self._get_tick(major=True) for i in range(1)])
 File "d:\Program Files\Python-2.5.1\Lib\site-packages\matplotlib\axis.py",
line 1033, in _get_tick
 return XTick(self.axes, 0, '', major=major)
 File "d:\Program Files\Python-2.5.1\Lib\site-packages\matplotlib\axis.py",
line 96, in __init__
 self.tick1line = self._get_tick1line(loc)
 File "d:\Program Files\Python-2.5.1\Lib\site-packages\matplotlib\axis.py",
line 285, in _get_tick1line
 markersize=self._size,
 File "d:\Program
Files\Python-2.5.1\Lib\site-packages\matplotlib\lines.py", line 284, in
__init__
 self.set_data(xdata, ydata)
 File "d:\Program
Files\Python-2.5.1\Lib\site-packages\matplotlib\lines.py", line 405, in
set_data
 self.recache()
 File "d:\Program
Files\Python-2.5.1\Lib\site-packages\matplotlib\lines.py", line 410, in
recache
 x = ma.asarray(self.convert_xunits(self._xorig), float)
 File "D:\Program Files\Python-2.5.1\Lib\site-packages\numarray\ma\MA.py",
line 2164, in asarray
 return array(data, typecode=typecode, copy=0)
 File "D:\Program Files\Python-2.5.1\Lib\site-packages\numarray\ma\MA.py",
line 628, in __init__
 c = Numeric.array(data, tc, savespace=ss)
 File "D:\Program
Files\Python-2.5.1\Lib\site-packages\numarray\numarraycore.py", line 334, in
array
 type=_nt._typeFromKeywords(type,typecode,dtype)
 File "d:\Program
Files\Python-2.5.1\Lib\site-packages\numarray\numerictypes.py", line 474, in
_typeFromKeywords
 return getType(typecode)
 File "d:\Program
Files\Python-2.5.1\Lib\site-packages\numarray\numerictypes.py", line 450, in
getType
 raise TypeError("Not a numeric type")
TypeError: Not a numeric type
Has anyone an idea?
Thanks Thorsten
-- 
View this message in context: http://www.nabble.com/problems-with-0.91.1-and-python-2.5.1-tp14269662p14269662.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
From: Mario O. <mar...@hp...> - 2007年12月11日 02:12:23
Hi,
since I have the need of multiple histograms on one axes to compare
different distributions and this feature was quite often requested
in the past on this list I have written a new method for the axes
class to implement this.
This method 'multihist' works essentially the same as the original
hist method. The input data is given as first non keyword argument
which has to be a sequence of sequences containing the different
data sets. Additionally three new parameters to the original hist
parameters (whose semantics have not changed) where introduced:
type = 'overlap' | 'beside' | 'bi'. This denotes how the different
histograms are rendered (either overlapping, with the bars beside
each other or as suggested in a previous post as bihistogram, see:
http://www.itl.nist.gov/div898/handbook/eda/section3/bihistog.htm
gap: the gap between bars when in 'beside' mode
patch_kwargs: this is a sequence of dicts containing the kwargs
that are passed to the bar/barh methods for generating the bar
patches. With these the look of the different patches for each
data set can be assigned.
The method returns (similar to hist)
xn, bins, patch_list
where xn is a sequence of the histogram data sets, bins are the
shared bins (no sequence) ad patch_list is a sequence of the
different patch sets for each data set
Please see the attached patch and example program for details.
I'd be happy to hear If you find this useful - especially since
I haven't tested many corner cases (different widths, orientations, bottoms etc.)
and cooked this up rather quickly.
Thanks,
Mario Oschwald
From: Takashi Y. <tak...@ho...> - 2007年12月11日 00:37:24
Hi,
I have recently come across Matplotlib and I am very impressed with its cap=
abilities. I am new to both Matplotlib and Python, although I have several =
years experience with C++ and a few other languages *(including modelling w=
ith MatLab).
I have successfully embedded Python in a C++ application, and can run pytho=
n scripts from my C++ application. However, I have found displaying graphs =
in a GUI fraught with (insurmountable?) problems and I have decided to NOT =
use a GUI at all, but rather, to save plots as image, to file (e.g. png, gi=
f or jpeg).
Can anyone give me a simple example script that shows how I may use savefig=
(), to save a plot as an image (any of the above formats), to file?
Thanks
_________________________________________________________________
Connect to the next generation of MSN Messenger=A0
http://imagine-msn.com/messenger/launch80/default.aspx?locale=3Den-us&sourc=
e=3Dwlmailtagline=
From: Tim L. <ti...@gm...> - 2007年12月10日 23:01:27
I deleted my /.matplotlib/fontManager.cache file and ran the script
again, and now everything is working fine.
Thank you for your help.
>It appears to be finding "wadalab-gothic" as the font, which is a=20
>Japanese font. Now, *why* it is doing that is the million dollar =
question.
>
>It should (by default) by loading the Bitstream Vera Sans font=20
>(Vera.ttf) from=20
>/usr/local/lib/python2.4/site-packages/matplotlib/mpl-data/fonts/ttf. I=
=20
>would verify that it is there and readable by the "user" that the CGI=20
>script runs under. You can try refreshing the font-finding cache by=20
>removing the file ~/.matplotlib/fontManager.cache.
>
>If that doesn't provide any clues, can you send me the fontManager.cache=
=20
>(probably best off-list), and I'll see what fonts it *is* finding, again=
=20
> hopefully providing more clues.
>
>One other thing to note about the output: it is loading the matplotlibrc=
=20
>from /home/www/www/cgi-bin/, (since it is present), and not from=20
>/home/private/mpl/.matplotlib/. Perhaps there is something incorrect in=
=20
>that matplotlibrc file.
>
>Cheers,
>Mike
>
>Tim Lewis wrote:
>>> Can you set "verbose.level" to "debug-annoying" in your matplotlibrc =
and=20
>>> send us the output? That may help provide an explanation as to why =
the=20
>>> text is not appearing. Also, for good measure, can you provide your=20
>>> matplotlibrc file, and information about the platform and versions of=
=20
>>> Python that you are using? =20
>>=20
>> See the attachments. Their platform is RedHat Linux and python 2.4.3
>>=20
>>> Do you get different results when you run at=20
>>> the commandline vs. from an http request? It could be that incorrect=
=20
>>> permissions (as user "apache", for instance) are causing the =
problems.
>>>
>>> Cheers,
>>> Mike
>>=20
>> I'd like to run it from the command line, but I haven't done it before
>> (and not sure how to do it); the web hosting server is in a land far
>> far away. :-) I am just running the script from a http request. I
>> can probably have them run it if need to.
>>=20
>> Thanks,
>>=20
>>> Tim Lewis wrote:
>>>> I'm using the code from=20
>>>> =
http://www.scipy.org/Cookbook/Matplotlib/Using_MatPlotLib_in_a_CGI_script=
=20
>>>> to generate plots from my web server. The plot shows up fine (w/o =
text)=20
>>>> but when I use xlabel("x-axis"), ylabel("y-axis"), or title("A =
Chart");=20
>>>> no text shows up on the plot. Everything seems fine with the =
install=20
>>>> and I don't get any errors when I run the script. It seems that =
that=20
>>>> matplotlib is unable to find the font's and just simply ignores them=
 --=20
>>>> I really dunno.
>>>>
>>>> Any suggestions?
>>>>
>>>>
>>>> =
------------------------------------------------------------------------
>>>>
>>>> =
-------------------------------------------------------------------------
>>>> SF.Net email is sponsored by:=20
>>>> Check out the new SourceForge.net Marketplace.
>>>> It's the best place to buy or sell services for
>>>> just about anything Open Source.
>>>> http://sourceforge.net/services/buy/index.php
>>>>
>>>>
>>>> =
------------------------------------------------------------------------
>>>>
>>>> _______________________________________________
>>>> Matplotlib-users mailing list
>>>> Mat...@li...
>>>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
From: John H. <jd...@gm...> - 2007年12月10日 20:46:10
On Dec 10, 2007 11:53 AM, Venkat Ramanan <ve...@sr...> wrote:
> If anyone faces a similar issue, there is a solution here.
>
> http://scipy.org/Cookbook/Matplotlib/Interactive_Plotting
>
> Essentially, we should also check for "toolbar.mode"
You may also want to look at the widget lock variable, which the
toolbar manages and user code can acquire or view the lock, eg
examples/lasso_demo.py. This is somewhat more robust than using the
toolbar mode string because it will allow other code, not part of the
toolbar, to share and use the lock.
 def callback(self, verts):
 ind = nonzero(points_inside_poly(self.xys, verts))[0]
 for i in range(self.Nxy):
 if i in ind:
 self.facecolors[i] = Datum.colorin
 else:
 self.facecolors[i] = Datum.colorout
 self.canvas.draw_idle()
 self.canvas.widgetlock.release(self.lasso)
 del self.lasso
 def onpress(self, event):
 if self.canvas.widgetlock.locked(): return
 if event.inaxes is None: return
 self.lasso = Lasso(event.inaxes, (event.xdata, event.ydata),
self.callback)
 # acquire a lock on the widget drawing
 self.canvas.widgetlock(self.lasso)
From: Venkat R. <ve...@sr...> - 2007年12月10日 17:53:47
If anyone faces a similar issue, there is a solution here.
http://scipy.org/Cookbook/Matplotlib/Interactive_Plotting
Essentially, we should also check for "toolbar.mode"
Thanks,
Venkat.
Venkat Ramanan wrote:
> Hi,
>
> I have written a simple image viewing tool with window/level controls 
> linked to the right mouse, which generally works okay.
>
> But when I use the pan/zoom button, clicking and dragging the right 
> mouse button changes the zoom as intended, but also affects the 
> window/level too which is undesirable.
>
> How to change the callback so that the pan/zoom mode doesn't affect 
> window/level?
>
> The code is attached.
>
> If there are better image viewing tools using matplotlib, I can 
> upgrade, but I couldn't find them on a quick search. The goal is to 
> add some plotting capability ( plot row, col on user-specified 
> coordinates) and some ROI drawing capability. ( See my other post for 
> those questions. )
>
> Matplotlib: 0.87.7, python: 2.5 ubuntu 7.04
>
> Thanks,
> Venkat.
>
> ------------------------------------------------------------------------
>
> #!/usr/bin/env python
> import scipy
> import pylab
> from pylab import cos, sqrt, arctan2, sqrt,pi,cm, clim, get_current_fig_manager
> import sys
> # Displaying an image with window/level controls
> # from matplotlib
>
> pylab.ion()
>
> xstart = 0;
> ystart = 0;
> win = 0;
> lev = 0;
> vmax_orig = 0;
> vmin_orig = 0;
>
> def on_click(event):
> #get the x and y coords, flip y from top to bottom
> global win,lev
> win = im.norm.vmax - im.norm.vmin;
> lev = (im.norm.vmax + im.norm.vmin)/2;
> x, y = event.x, event.y;
> if event.button==3:
> if event.inaxes is not None:
> global xstart,ystart
> xstart = event.xdata;
> ystart = event.ydata;
> #print 'click:data coords', event.xdata, event.ydata;
>
> def on_move(event):
> #get the x and y pixel coords
> x, y = event.x, event.y
> scale = 10;
> if event.button==3:
> if event.inaxes is not None:
> xdelta = event.xdata - xstart;
> ydelta = event.ydata - ystart;
> xratio = xdelta / (im.get_extent()[1]-im.get_extent()[0]);
> yratio = ydelta / (im.get_extent()[3]-im.get_extent()[2]);
>
> new_win = xratio*scale + win;
> new_lev = yratio*scale + lev;
> if new_win < 0: new_win = 0;
> 
> clim_high = new_lev + new_win/2;
> clim_low = new_lev - new_win/2;
> clim(clim_low,clim_high);
>
> #print 'move:deltas', xdelta, ydelta
> #print 'clim_low: ', clim_low, 'clim_high: ', clim_high
>
> def on_release(event):
> global win,lev
> x, y = event.x, event.y
> if event.button==2:
> if event.inaxes is not None:
> clim(vmin_orig,vmax_orig);
> print 'release: vmin: ',im.norm.vmin,'vmax: ',im.norm.vmax
>
> def viewimage(imdata):
> global im,vmax_orig,vmin_orig
> im=pylab.imshow(imdata,origin='lower',cmap=cm.gray);
> vmax_orig = im.norm.vmax;
> vmin_orig = im.norm.vmin;
> binding_id = pylab.connect('motion_notify_event', on_move)
> pylab.connect('button_press_event', on_click)
> pylab.connect('button_release_event', on_release)
> pylab.show();
>
> def main():
> # Creating the grid of coordinates x,y 
> x,y = scipy.ogrid[-1.:1.:.01, -1.:1.:.01]
> z = 3*y*(3*x**2-y**2)/4 + .5*cos(6*pi * sqrt(x**2 +y**2) + arctan2(x,y))
> viewimage(z);
>
> if __name__ == '__main__':
> main()
> 
> ------------------------------------------------------------------------
>
> -------------------------------------------------------------------------
> SF.Net email is sponsored by: 
> Check out the new SourceForge.net Marketplace.
> It's the best place to buy or sell services for
> just about anything Open Source.
> http://sourceforge.net/services/buy/index.php
> ------------------------------------------------------------------------
>
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> 
From: Venkat R. <ve...@sr...> - 2007年12月10日 17:49:36
Thanks for the pointer. The matplotlib.widget.Cursor works much better 
for displaying crosshairs. ( due to blitting? )
I still haven't found a tool yet for drawing a polygon. The 
lasso_demo.py doesn't run on my system. Well, it runs, displays a 
scatter of points, but I'm not sure what is it supposed to do next.
Thanks,
Venkat.
PS: Sorry for personal post, I meant to post to the list but forgot to 
'reply all'
Darren Dale wrote:
> On Friday 07 December 2007 7:19:04 am José Gómez-Dans wrote:
> 
>> Hi,
>>
>> On Thursday 06 December 2007 19:39:59 Venkat Ramanan wrote:
>> 
>>> I'm looking for something analogous to Matlab's ginput() and roipoly().
>>> 
>> I'm no expert on this, but have a look at the lasso_demo.py example, which
>> shows something akin to roipoly(), and pick_event_demo.py and
>> pick_even_demo2.py, which show something like ginput() (although I think no
>> cross hairs :D).
>> 
>
> Check out cursor_demo.py and matplotlib.widgets.Cursor for cross hairs.
>
> -------------------------------------------------------------------------
> SF.Net email is sponsored by: 
> Check out the new SourceForge.net Marketplace.
> It's the best place to buy or sell services for
> just about anything Open Source.
> http://sourceforge.net/services/buy/index.php
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> 
-- 
Venkat Ramanan,
Research Associate,
Imaging Research,
Sunnybrook Health Sciences Centre,
2075 Bayview Ave,
Toronto-M4N3M5
Ontario, Canada
From: Michael D. <md...@st...> - 2007年12月10日 14:56:48
You can use something like:
 subplots_adjust(left=0.3)
The value is in the range 0.0 - 1.0, and is spaced evenly across the 
whole figure.
Cheers,
Mike
Gerolf Ziegenhain wrote:
> Dear Mailinglist,
> 
> I want to create a horizontal historgram. The y-labels have more text, 
> than fits in the _normal_ layout. How could I increase the width of the 
> yticks legend?
> 
> Best regards:
> Gerolf
> 
> -- 
> Dipl. Phys. Gerolf Ziegenhain (ge...@zi... 
> <mailto:ge...@zi...>)
> Private: Klopstockstrasse 21 - 65187 Wiesbaden - Germany
> Office: Room 46-332 - Erwin-Schrödinger-Str.46 - TU Kaiserslautern - 
> Germany
> Web: gerolf.ziegenhain.com <http://gerolf.ziegenhain.com>
> 
> 
> ------------------------------------------------------------------------
> 
> -------------------------------------------------------------------------
> SF.Net email is sponsored by: 
> Check out the new SourceForge.net Marketplace.
> It's the best place to buy or sell services for
> just about anything Open Source.
> http://sourceforge.net/services/buy/index.php
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> 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: Darren D. <dar...@co...> - 2007年12月10日 13:52:35
On Monday 10 December 2007 8:21:03 am Michael Droettboom wrote:
> It appears to be finding "wadalab-gothic" as the font, which is a
> Japanese font. Now, *why* it is doing that is the million dollar question.
>
> It should (by default) by loading the Bitstream Vera Sans font
> (Vera.ttf) from
> /usr/local/lib/python2.4/site-packages/matplotlib/mpl-data/fonts/ttf. I
> would verify that it is there and readable by the "user" that the CGI
> script runs under. You can try refreshing the font-finding cache by
> removing the file ~/.matplotlib/fontManager.cache.
>
> If that doesn't provide any clues, can you send me the fontManager.cache
> (probably best off-list), and I'll see what fonts it *is* finding, again
> hopefully providing more clues.
>
> One other thing to note about the output: it is loading the matplotlibrc
> from /home/www/www/cgi-bin/, (since it is present), and not from
> /home/private/mpl/.matplotlib/. Perhaps there is something incorrect in
> that matplotlibrc file.
The matplotlibrc file was basically using all defaults. Have you tried 
deleting your site-packages/matplotlib* and the build/ directory from your 
mpl sources, and reinstalling?
Darren
> Tim Lewis wrote:
> >> Can you set "verbose.level" to "debug-annoying" in your matplotlibrc and
> >> send us the output? That may help provide an explanation as to why the
> >> text is not appearing. Also, for good measure, can you provide your
> >> matplotlibrc file, and information about the platform and versions of
> >> Python that you are using?
> >
> > See the attachments. Their platform is RedHat Linux and python 2.4.3
> >
> >> Do you get different results when you run at
> >> the commandline vs. from an http request? It could be that incorrect
> >> permissions (as user "apache", for instance) are causing the problems.
> >>
> >> Cheers,
> >> Mike
> >
> > I'd like to run it from the command line, but I haven't done it before
> > (and not sure how to do it); the web hosting server is in a land far
> > far away. :-) I am just running the script from a http request. I
> > can probably have them run it if need to.
> >
> > Thanks,
> >
> >> Tim Lewis wrote:
> >>> I'm using the code from
> >>> http://www.scipy.org/Cookbook/Matplotlib/Using_MatPlotLib_in_a_CGI_scri
> >>>pt to generate plots from my web server. The plot shows up fine (w/o
> >>> text) but when I use xlabel("x-axis"), ylabel("y-axis"), or title("A
> >>> Chart"); no text shows up on the plot. Everything seems fine with the
> >>> install and I don't get any errors when I run the script. It seems
> >>> that that matplotlib is unable to find the font's and just simply
> >>> ignores them -- I really dunno.
> >>>
> >>> Any suggestions?
From: Michael D. <md...@st...> - 2007年12月10日 13:21:14
It appears to be finding "wadalab-gothic" as the font, which is a 
Japanese font. Now, *why* it is doing that is the million dollar question.
It should (by default) by loading the Bitstream Vera Sans font 
(Vera.ttf) from 
/usr/local/lib/python2.4/site-packages/matplotlib/mpl-data/fonts/ttf. I 
would verify that it is there and readable by the "user" that the CGI 
script runs under. You can try refreshing the font-finding cache by 
removing the file ~/.matplotlib/fontManager.cache.
If that doesn't provide any clues, can you send me the fontManager.cache 
(probably best off-list), and I'll see what fonts it *is* finding, again 
 hopefully providing more clues.
One other thing to note about the output: it is loading the matplotlibrc 
from /home/www/www/cgi-bin/, (since it is present), and not from 
/home/private/mpl/.matplotlib/. Perhaps there is something incorrect in 
that matplotlibrc file.
Cheers,
Mike
Tim Lewis wrote:
>> Can you set "verbose.level" to "debug-annoying" in your matplotlibrc and 
>> send us the output? That may help provide an explanation as to why the 
>> text is not appearing. Also, for good measure, can you provide your 
>> matplotlibrc file, and information about the platform and versions of 
>> Python that you are using? 
> 
> See the attachments. Their platform is RedHat Linux and python 2.4.3
> 
>> Do you get different results when you run at 
>> the commandline vs. from an http request? It could be that incorrect 
>> permissions (as user "apache", for instance) are causing the problems.
>>
>> Cheers,
>> Mike
> 
> I'd like to run it from the command line, but I haven't done it before
> (and not sure how to do it); the web hosting server is in a land far
> far away. :-) I am just running the script from a http request. I
> can probably have them run it if need to.
> 
> Thanks,
> 
>> Tim Lewis wrote:
>>> I'm using the code from 
>>> http://www.scipy.org/Cookbook/Matplotlib/Using_MatPlotLib_in_a_CGI_script 
>>> to generate plots from my web server. The plot shows up fine (w/o text) 
>>> but when I use xlabel("x-axis"), ylabel("y-axis"), or title("A Chart"); 
>>> no text shows up on the plot. Everything seems fine with the install 
>>> and I don't get any errors when I run the script. It seems that that 
>>> matplotlib is unable to find the font's and just simply ignores them -- 
>>> I really dunno.
>>>
>>> Any suggestions?
>>>
>>>
>>> ------------------------------------------------------------------------
>>>
>>> -------------------------------------------------------------------------
>>> SF.Net email is sponsored by: 
>>> Check out the new SourceForge.net Marketplace.
>>> It's the best place to buy or sell services for
>>> just about anything Open Source.
>>> http://sourceforge.net/services/buy/index.php
>>>
>>>
>>> ------------------------------------------------------------------------
>>>
>>> _______________________________________________
>>> 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: Emmanuel Favre-N. <man...@gm...> - 2007年12月10日 03:21:08
Hi,
I've a little problem with date conversion. I have a csv file which looks 
like :
"Data","Valor"
"15/01/2007"," 6,700012000"
"12/01/2007"," 6,659903000"
"11/01/2007"," 6,701586000"
I try to get date using function strpdate2num in load doing this :
from pylab import datestr2num, load
def comma_nb2float(A):
 return eval(A.replace(',','.'))
dates, valor = 
load("file.csv",delimiter=',',converters={0:strpdate2num('%d/%m/%Y'),1:comma_nb2float},skiprows=1, 
usecols=(0,1),unpack=True)
I got the following error message :
---------------------------------------------------------------------------
exceptions.ValueError Traceback (most recent 
call last)
/home/manu/Documents/Perso/....../<ipython console>
/usr/lib/python2.4/site-packages/matplotlib/mlab.py in load(fname, comments, 
delimiter, converters, skiprows, usecols, unpack)
 1353 if usecols is not None:
 1354 vals = line.split(delimiter)
-> 1355 row = [converterseq[j](vals[j]) for j in usecols]
 1356 else:
 1357 row = [converterseq[j](val) for j,val in 
enumerate(line.split(delimiter))]
/usr/lib/python2.4/site-packages/matplotlib/dates.py in __call__(self, s)
 182 return value: a date2num float
 183 """
--> 184 return date2num(datetime.datetime(*time.strptime(s, self.fmt)
[:6]))
 185
 186 def datestr2num(d):
/usr/lib/python2.4/_strptime.py in strptime(data_string, format)
 291 found = format_regex.match(data_string)
 292 if not found:
--> 293 raise ValueError("time data did not match format: data=%s 
fmt=%s" %
 294 (data_string, format))
 295 if len(data_string) != found.end():
ValueError: time data did not match format: data="15/01/2007" fmt=%d/%m/%Y
I didn't understood the problem, anyone can help me ?
From: C M <cmp...@gm...> - 2007年12月10日 01:53:37
On Dec 9, 2007 7:57 PM, Jordan Atlas <jc...@co...> wrote:
> Hello all,
>
> Does matplotlib allow the control of "fill" in data plots? For
> example, plotting data as 'empty' squares as opposed to 'filled'
> squares? I haven't been able to find anything in the documentation and
> I'm wondering if maybe I'm searching for the wrong keywords.
>
> Thank you,
>
> --Jordan
>
It does. Looking at everything listed under the axes class in matplotlib
is a good idea, there's lots there. There you find .plot() itself, and
under that
there is a description of all the aspects you can control in plotting
markers
(the circles, squares, etc. that you plot). Included there is mfc, or
marker
face color, which you can set to white or whatever the background of the
plot is so it appears unfilled. There's also edge color, edge width, marker
size, etc. See here:
http://matplotlib.sourceforge.net/matplotlib.axes.html
From: Tom J. <tj...@gm...> - 2007年12月10日 01:48:22
I am plotting multiple scatter plots to the same axis. For each
scatter plot, all points have the same shape and color. I would like
the legend to display the shape and color of the data points in each
collection (rather than displaying a rectangle for the color). The
result should be similar to the output from:
 plot(range(10), 'bo', label='1')
 legend()
The benefit with scatter is that I can have each data point being a
different size.
From: Jordan A. <jc...@co...> - 2007年12月10日 00:57:56
Hello all,
 Does matplotlib allow the control of "fill" in data plots? For 
example, plotting data as 'empty' squares as opposed to 'filled' 
squares? I haven't been able to find anything in the documentation and 
I'm wondering if maybe I'm searching for the wrong keywords.
Thank you,
--Jordan
1 message has been excluded from this view by a project administrator.

Showing results of 331

<< < 1 .. 4 5 6 7 8 .. 14 > >> (Page 6 of 14)
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 によって変換されたページ (->オリジナル) /