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

Showing results of 398

<< < 1 .. 4 5 6 7 8 .. 16 > >> (Page 6 of 16)
From: MICHAEL P M. <Mic...@jp...> - 2006年03月21日 01:31:51
This is a question about controlling the font size of axis tick labels, in a linear numeric axis.
More specifically it is about this situation: You know how sometimes, when the numeric labels represent very large/small numbers that need scientific notation, the power of 10 exponent is placed separately from the rest of the tick labels, at the high end of the axis? I want to change the size of that separate label. calling xAxisInstance.get_ticklabels(), looping on that, and setting font size, doesn't do it---apparently that one separate label is not included in the return list.
Mike
From: Daniel M. <dan...@ya...> - 2006年03月20日 22:02:53
Charlie Moad <cwmoad@...> writes:
> 
> Are you using numarray as your numerix? If so, is it specified in
> matplotlibrc of the exe bundle?
Charlie,
Yes. I'm using numarray for numerix. I've specified this in a local matplotlibrc
file that configures my application, as well as the default matplotlibrc file in
the C:\Python24\Lib\site-packages\matplotlib\mpl-data directory.
My .exe is called VizTool.exe. The output from VizTool.exe.log is :
Traceback (most recent call last):
 File "VizTool.py", line 2, in ?
 File "VizTool\Controllers.pyo", line 4, in ?
 File "VizTool\GraphPanels.pyo", line 1, in ?
 File "wxmpl.pyo", line 32, in ?
 File "matplotlib\numerix\__init__.pyo", line 145, in ?
ImportError: No module named random_array
Any suggestions?
As always, thanks for the help.
Regards,
Daniel McQuillen
Oakland, CA
From: massimo s. <mas...@un...> - 2006年03月20日 17:50:45
Attachments: massimo.sandal.vcf
Further little testing I forgot...
Printing disconnect_id gives me an id, so there is an answer from 
self.control.mpl_connect() ...
I also tested with 'key_press_event' to see if the mouse events were the 
problem, but no luck...
m.
-- 
Massimo Sandal
University of Bologna
Department of Biochemistry "G.Moruzzi"
snail mail:
Via Irnerio 48, 40126 Bologna, Italy
email:
mas...@un...
tel: +39-051-2094388
fax: +39-051-2094387
From: massimo s. <mas...@un...> - 2006年03月20日 17:46:12
Attachments: massimo.sandal.vcf
Hi,
I'm building a simple wxpython + matplotlib application using wxmpl (no 
pylab).
I'm currently trying to get X and Y coordinates of a point I click 
inside a graph plotted in a PlotPanel.
So I'm trying to connect the PlotPanel to a button_press_event. The 
problem is it fails silently. No error, but it seems that the connected 
function is never called and even that the connecting itself never happens.
My hypothesis: I see that the PlotPanel has default zooming when 
selecting a box with the mouse, so I think it is already connected with 
button_press_event? should I disconnect? how (what's the id)? Should I 
use something different from PlotPanel?
-------------------
Here are relevant code snippets:
class MainWindow(wx.Frame):
 def __init__(self,parent,id,title):
 
wx.Frame.__init__(self,parent,ID_FRAME,title,size=(800,600),style=wx.DEFAULT_FRAME_STYLE|wx.NO_FULL_REPAINT_ON_RESIZE)
 self.control=wxmpl.PlotPanel(self,1)
[Then, if I send the right wxpython event (I want my plot giving me 
coordinates only when I say the gui to do it), I call ClickPlot, that 
should turn on the connection between the mpl event 'button_press_event' 
and another function, for my PlotPanel.]
def ClickPlot(self,event):
 #test code
 print 'you're calling ClickPlot()'
 def click_me(mpl_event):
		#test code
 print 'you click me!'
 if mpl_event.inaxes:
 print 'in axes too!'
 	
 disconnect_id=self.control.mpl_connect('button_press_event',click_me)
--------------------------
I checked and ClickPlot() is called, but as said before, click_me() is 
not. Any idea? What could I do to figure out what's (not) happening?
Thanks,
Massimo
-- 
Massimo Sandal
University of Bologna
Department of Biochemistry "G.Moruzzi"
snail mail:
Via Irnerio 48, 40126 Bologna, Italy
email:
mas...@un...
tel: +39-051-2094388
fax: +39-051-2094387
From: Randewijk P-J <pjr...@su...> - 2006年03月20日 15:32:31
Darren,
I tried "idle -n" and got the same result:
Python 2.4.2 (#67, Sep 28 2005, 12:41:11) [MSC v.1310 32 bit (Intel)] on
win32 Type "copyright", "credits" or "license()" for more information.
 ****************************************************************
 Personal firewall software may warn about the connection IDLE
 makes to its subprocess using this computer's internal loopback
 interface. This connection is not visible on any external
 interface and no data is sent to or received from the Internet.
 ****************************************************************
 =20
IDLE 1.1.2 =3D=3D=3D=3D No Subprocess =3D=3D=3D=3D
>>> import subprocess
>>> process =3D subprocess.Popen(['dir'], shell=3DTrue,=20
>>> stdout=3Dsubprocess.PIPE, stderr=3Dsubprocess.STDOUT)
Traceback (most recent call last):
 File "<pyshell#1>", line 1, in ?
 process =3D subprocess.Popen(['dir'], shell=3DTrue,
stdout=3Dsubprocess.PIPE, stderr=3Dsubprocess.STDOUT)
 File "C:\Python\lib\subprocess.py", line 533, in __init__
 (p2cread, p2cwrite,
 File "C:\Python\lib\subprocess.py", line 593, in _get_handles
 p2cread =3D self._make_inheritable(p2cread)
 File "C:\Python\lib\subprocess.py", line 634, in _make_inheritable
 DUPLICATE_SAME_ACCESS)
TypeError: an integer is required
PJR
> -----Original Message-----
> From: mat...@li...
> [mailto:mat...@li...] On=20
> Behalf Of Darren Dale
> Sent: 20 March 2006 16:19
> To: mat...@li...
> Subject: Re: [Matplotlib-users] matplotlib-0.87.2 on Windows=20
> - using subprocess.Popen()
>=20
>=20
> On Monday 20 March 2006 09:03, Randewijk P-J
> <pjr...@su...> wrote:
> > Darren,
> >
> > I prefer using PythonWin to IDLE. Any ideas how to solve the
> > subprocess.Popen() problem using PythonWin? What about using
> > "win32pipe"?
>=20
> I don't know how to solve it for pythonwin, maybe you could
> investigate it=20
> with a google search (thats how I learned about the problem=20
> and the solution=20
> for idle).
>=20
> I suppose win32pipe is part of pywin32. If that is the case,
> I dont think I=20
> can support using it; we are trying to eliminate=20
> dependencies, not add to=20
> them. Subprocess is acceptable because it is part of the=20
> python-2.4 standard=20
> library and we were able to add it to the mpl tree for older=20
> versions of=20
> python.
>=20
> Darren
>=20
> > -----Original Message-----
> > From: Darren Dale [mailto:dd...@co...]
> > Sent: 20 March 2006 15:52
> > To: Randewijk P-J <pjr...@su...>
> > Subject: Re: ASPN : Python Cookbook : Module to allow Asynchronous
> > subprocess use on Windows and Posix platforms
> >
> >
> > I forgot to mention, you may be able to avoid these errors
> by starting
> > idle with the -n flag.
> >
> > On Monday 20 March 2006 08:36, you wrote:
> > > Aha!
> > >
> > > In both the IDLE & PythonWin (my default my using pylab)
> shells it
> > > fails... but not from the python shell...
> > >
> > > PJR
> > >
> > > > -----Original Message-----
> > > > From: Darren Dale [mailto:dd...@co...]
> > > > Sent: 20 March 2006 15:25
> > > > To: Randewijk P-J <pjr...@su...>
> > > > Subject: Re: ASPN : Python Cookbook : Module to allow
> Asynchronous
> > > > subprocess use on Windows and Posix platforms
> > > >
> > > >
> > > > Also, are you running this from IDLE? If so, please try
> running it
> > > > from a regular python shell, or better, run a script
> from the dos
> > > > shell.
> > > >
> > > > On Monday 20 March 2006 08:06, you wrote:
> > > > > This is what I get:
> > > > > >>> import subprocess
> > > > > >>> process =3D subprocess.Popen(['dir'], shell=3DTrue,
> > > > >
> > > > > stdout=3Dsubprocess.PIPE,stderr=3Dsubprocess.STDOUT)
> > > > > Traceback (most recent call last):
> > > > > File "<interactive input>", line 1, in ?
> > > > > File "C:\Python\lib\subprocess.py", line 533, in __init__
> > > > > (p2cread, p2cwrite,
> > > > > File "C:\Python\lib\subprocess.py", line 593, in
> _get_handles
> > > > > p2cread =3D self._make_inheritable(p2cread)
> > > > > File "C:\Python\lib\subprocess.py", line 634, in
> >
> > _make_inheritable
> >
> > > > > DUPLICATE_SAME_ACCESS)
> > > > > TypeError: an integer is required
> > > > >
> > > > > PJR
> > > > >
> > > > > > -----Original Message-----
> > > > > > From: Darren Dale [mailto:dd...@co...]
> > > > > > Sent: 20 March 2006 14:49
> > > > > > To: Randewijk P-J <pjr...@su...>
> > > > > > Subject: Re: ASPN : Python Cookbook : Module to allow
> > > >
> > > > Asynchronous
> > > >
> > > > > > subprocess use on Windows and Posix platforms
> > > > > >
> > > > > >
> > > > > > Hi P-J,
> > > > > >
> > > > > > On Monday 20 March 2006 7:39 am, you wrote:
> > > > > > > Dear Darren,
> > > > > > >
> > > > > > > Maybe this could help solve the Windows problem with
> > > > > >
> > > > > > Popen()... don't
> > > > > >
> > > > > > > know about the 2.3 issue however...
> > > > > > >
> > > > > > >=20
> http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/4405
> > > > > > > 54
> > > > > >
> > > > > > I'm not convinced that there is an issue with
> subprocess.Popen
> > > > > > in windows. I tested the following block on windows (with
> > > >
> > > > python-2.4)
> > > >
> > > > > > and it worked fine.
> > > > > >
> > > > > > import subprocess
> > > > > > process =3D subprocess.Popen(['dir'], shell=3DTrue,
> > > > > > stdout=3Dsubprocess.PIPE,
> > > > > > stderr=3Dsubprocess.STDOUT)
> > > > > > stat =3D process.wait()
> > > > > > print process.stdout.read()
> > > > > >
> > > > > > I posted this to the list last week. Did you test it?
> > > >
> > > > --
> > > > Darren S. Dale, Ph.D.
> > > > Cornell High Energy Synchrotron Source
> > > > Cornell University
> > > > 200L Wilson Lab
> > > > Rt. 366 & Pine Tree Road
> > > > Ithaca, NY 14853
> > > >
> > > > dd...@co...
> > > > office: (607) 255-9894
> > > > fax: (607) 255-9001
>=20
> --
> Darren S. Dale, Ph.D.
> Cornell High Energy Synchrotron Source
> Cornell University
> 200L Wilson Lab
> Rt. 366 & Pine Tree Road
> Ithaca, NY 14853
>=20
> dd...@co...
> office: (607) 255-9894
> fax: (607) 255-9001
>=20
>=20
> -------------------------------------------------------
> This SF.Net email is sponsored by xPML, a groundbreaking
> scripting language that extends applications into web and=20
> mobile media. Attend the live webcast and join the prime=20
> developer group breaking into this new coding territory!=20
> http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=3D110944&bid=3D241720&
dat=3D121642
_______________________________________________
Matplotlib-users mailing list Mat...@li...
https://lists.sourceforge.net/lists/listinfo/matplotlib-users
From: John H. <jdh...@ac...> - 2006年03月20日 15:30:32
>>>>> "David" == David Huard <dav...@gm...> writes:
 David> Hi, When using an imshow command whose extent is larger
 David> than the axes limits, the axes are partially hidden by the
 David> image. That is, one half of the axis line is hidden and the
 David> other appears fine. I made sure that ax.set_axisbelow is
 David> False, and I wish I knew what is causing this.
 David> I attached a screenshot of the png file, please look at the
 David> top axis.
 David> Using version 0.86.2
This appears related to the bug described in this patch
http://sourceforge.net/tracker/index.php?func=detail&aid=1444703&group_id=80706&atid=560722
When I reviewed this patch, I was concerned because I thought the fix
unneccessarily broke the API in order to fix the problem. I haven't
heard yet from Toon Verstraelen, who wrote the patch, about this
issue. You may want to take a look at it and see if it fixes your
problem too.
JDH
From: Darren D. <dd...@co...> - 2006年03月20日 14:18:51
On Monday 20 March 2006 09:03, Randewijk P-J <pjr...@su...> wrote:
> Darren,
>
> I prefer using PythonWin to IDLE. Any ideas how to solve the
> subprocess.Popen() problem using PythonWin? What about using
> "win32pipe"?
I don't know how to solve it for pythonwin, maybe you could investigate it 
with a google search (thats how I learned about the problem and the solution 
for idle).
I suppose win32pipe is part of pywin32. If that is the case, I dont think I 
can support using it; we are trying to eliminate dependencies, not add to 
them. Subprocess is acceptable because it is part of the python-2.4 standard 
library and we were able to add it to the mpl tree for older versions of 
python.
Darren
> -----Original Message-----
> From: Darren Dale [mailto:dd...@co...]
> Sent: 20 March 2006 15:52
> To: Randewijk P-J <pjr...@su...>
> Subject: Re: ASPN : Python Cookbook : Module to allow Asynchronous
> subprocess use on Windows and Posix platforms
>
>
> I forgot to mention, you may be able to avoid these errors by starting
> idle
> with the -n flag.
>
> On Monday 20 March 2006 08:36, you wrote:
> > Aha!
> >
> > In both the IDLE & PythonWin (my default my using pylab) shells it
> > fails... but not from the python shell...
> >
> > PJR
> >
> > > -----Original Message-----
> > > From: Darren Dale [mailto:dd...@co...]
> > > Sent: 20 March 2006 15:25
> > > To: Randewijk P-J <pjr...@su...>
> > > Subject: Re: ASPN : Python Cookbook : Module to allow Asynchronous
> > > subprocess use on Windows and Posix platforms
> > >
> > >
> > > Also, are you running this from IDLE? If so, please try running it
> > > from a regular python shell, or better, run a script from the dos
> > > shell.
> > >
> > > On Monday 20 March 2006 08:06, you wrote:
> > > > This is what I get:
> > > > >>> import subprocess
> > > > >>> process = subprocess.Popen(['dir'], shell=True,
> > > >
> > > > stdout=subprocess.PIPE,stderr=subprocess.STDOUT)
> > > > Traceback (most recent call last):
> > > > File "<interactive input>", line 1, in ?
> > > > File "C:\Python\lib\subprocess.py", line 533, in __init__
> > > > (p2cread, p2cwrite,
> > > > File "C:\Python\lib\subprocess.py", line 593, in _get_handles
> > > > p2cread = self._make_inheritable(p2cread)
> > > > File "C:\Python\lib\subprocess.py", line 634, in
>
> _make_inheritable
>
> > > > DUPLICATE_SAME_ACCESS)
> > > > TypeError: an integer is required
> > > >
> > > > PJR
> > > >
> > > > > -----Original Message-----
> > > > > From: Darren Dale [mailto:dd...@co...]
> > > > > Sent: 20 March 2006 14:49
> > > > > To: Randewijk P-J <pjr...@su...>
> > > > > Subject: Re: ASPN : Python Cookbook : Module to allow
> > >
> > > Asynchronous
> > >
> > > > > subprocess use on Windows and Posix platforms
> > > > >
> > > > >
> > > > > Hi P-J,
> > > > >
> > > > > On Monday 20 March 2006 7:39 am, you wrote:
> > > > > > Dear Darren,
> > > > > >
> > > > > > Maybe this could help solve the Windows problem with
> > > > >
> > > > > Popen()... don't
> > > > >
> > > > > > know about the 2.3 issue however...
> > > > > >
> > > > > > http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/440554
> > > > >
> > > > > I'm not convinced that there is an issue with subprocess.Popen
> > > > > in windows. I tested the following block on windows (with
> > >
> > > python-2.4)
> > >
> > > > > and it worked fine.
> > > > >
> > > > > import subprocess
> > > > > process = subprocess.Popen(['dir'], shell=True,
> > > > > stdout=subprocess.PIPE,
> > > > > stderr=subprocess.STDOUT)
> > > > > stat = process.wait()
> > > > > print process.stdout.read()
> > > > >
> > > > > I posted this to the list last week. Did you test it?
> > >
> > > --
> > > Darren S. Dale, Ph.D.
> > > Cornell High Energy Synchrotron Source
> > > Cornell University
> > > 200L Wilson Lab
> > > Rt. 366 & Pine Tree Road
> > > Ithaca, NY 14853
> > >
> > > dd...@co...
> > > office: (607) 255-9894
> > > fax: (607) 255-9001
-- 
Darren S. Dale, Ph.D.
Cornell High Energy Synchrotron Source
Cornell University
200L Wilson Lab
Rt. 366 & Pine Tree Road
Ithaca, NY 14853
dd...@co...
office: (607) 255-9894
fax: (607) 255-9001
From: Randewijk P-J <pjr...@su...> - 2006年03月20日 14:03:31
Darren,
I prefer using PythonWin to IDLE. Any ideas how to solve the
subprocess.Popen() problem using PythonWin? What about using
"win32pipe"?
PJR
-----Original Message-----
From: Darren Dale [mailto:dd...@co...]=20
Sent: 20 March 2006 15:52
To: Randewijk P-J <pjr...@su...>
Subject: Re: ASPN : Python Cookbook : Module to allow Asynchronous
subprocess use on Windows and Posix platforms
I forgot to mention, you may be able to avoid these errors by starting
idle=20
with the -n flag.
On Monday 20 March 2006 08:36, you wrote:
> Aha!
>
> In both the IDLE & PythonWin (my default my using pylab) shells it=20
> fails... but not from the python shell...
>
> PJR
>
> > -----Original Message-----
> > From: Darren Dale [mailto:dd...@co...]
> > Sent: 20 March 2006 15:25
> > To: Randewijk P-J <pjr...@su...>
> > Subject: Re: ASPN : Python Cookbook : Module to allow Asynchronous=20
> > subprocess use on Windows and Posix platforms
> >
> >
> > Also, are you running this from IDLE? If so, please try running it=20
> > from a regular python shell, or better, run a script from the dos=20
> > shell.
> >
> > On Monday 20 March 2006 08:06, you wrote:
> > > This is what I get:
> > > >>> import subprocess
> > > >>> process =3D subprocess.Popen(['dir'], shell=3DTrue,
> > >
> > > stdout=3Dsubprocess.PIPE,stderr=3Dsubprocess.STDOUT)
> > > Traceback (most recent call last):
> > > File "<interactive input>", line 1, in ?
> > > File "C:\Python\lib\subprocess.py", line 533, in __init__
> > > (p2cread, p2cwrite,
> > > File "C:\Python\lib\subprocess.py", line 593, in _get_handles
> > > p2cread =3D self._make_inheritable(p2cread)
> > > File "C:\Python\lib\subprocess.py", line 634, in
_make_inheritable
> > > DUPLICATE_SAME_ACCESS)
> > > TypeError: an integer is required
> > >
> > > PJR
> > >
> > > > -----Original Message-----
> > > > From: Darren Dale [mailto:dd...@co...]
> > > > Sent: 20 March 2006 14:49
> > > > To: Randewijk P-J <pjr...@su...>
> > > > Subject: Re: ASPN : Python Cookbook : Module to allow
> >
> > Asynchronous
> >
> > > > subprocess use on Windows and Posix platforms
> > > >
> > > >
> > > > Hi P-J,
> > > >
> > > > On Monday 20 March 2006 7:39 am, you wrote:
> > > > > Dear Darren,
> > > > >
> > > > > Maybe this could help solve the Windows problem with
> > > >
> > > > Popen()... don't
> > > >
> > > > > know about the 2.3 issue however...
> > > > >
> > > > > http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/440554
> > > >
> > > > I'm not convinced that there is an issue with subprocess.Popen=20
> > > > in windows. I tested the following block on windows (with
> >
> > python-2.4)
> >
> > > > and it worked fine.
> > > >
> > > > import subprocess
> > > > process =3D subprocess.Popen(['dir'], shell=3DTrue,=20
> > > > stdout=3Dsubprocess.PIPE,
> > > > stderr=3Dsubprocess.STDOUT)
> > > > stat =3D process.wait()
> > > > print process.stdout.read()
> > > >
> > > > I posted this to the list last week. Did you test it?
> >
> > --
> > Darren S. Dale, Ph.D.
> > Cornell High Energy Synchrotron Source
> > Cornell University
> > 200L Wilson Lab
> > Rt. 366 & Pine Tree Road
> > Ithaca, NY 14853
> >
> > dd...@co...
> > office: (607) 255-9894
> > fax: (607) 255-9001
--=20
Darren S. Dale, Ph.D.
Cornell High Energy Synchrotron Source
Cornell University
200L Wilson Lab
Rt. 366 & Pine Tree Road
Ithaca, NY 14853
dd...@co...
office: (607) 255-9894
fax: (607) 255-9001
From: Andrew S. <str...@as...> - 2006年03月19日 19:48:44
Jouni K Seppanen wrote:
>It looks like the sys.platform check is trying to guard against this
>condition, but plain Mac Python without py2app does not have
>sys.frozen. I suppose it would be better to check whether sys.frozen
>exists and then its truth value. Would the following change work for
>everyone?
> 
>
Hi Jouni,
I applied your patch in SVN revision 2166. Thanks for the pointer.
Cheers!
Andrew
From: Jouni K S. <jk...@ik...> - 2006年03月19日 18:57:27
"Charlie Moad" <cw...@gm...> writes:
> On 2/19/06, Josh Marshall <jos...@gm...> wrote:
>> Change the line to either:
>> if (sys.platform=='win32' or sys.platform=='darwin') and sys.frozen:
>
> Done.
This is causing problems on OS X, since (on at least Python 2.4.1 on
Tiger from http://undefined.org/python/) sys.platform is 'darwin' but
sys.frozen does not exist:
>>> sys.platform
'darwin'
>>> sys.frozen
Traceback (most recent call last):
 File "<stdin>", line 1, in ?
AttributeError: 'module' object has no attribute 'frozen'
It looks like the sys.platform check is trying to guard against this
condition, but plain Mac Python without py2app does not have
sys.frozen. I suppose it would be better to check whether sys.frozen
exists and then its truth value. Would the following change work for
everyone?
Index: lib/matplotlib/__init__.py
===================================================================
--- lib/matplotlib/__init__.py (revision 2151)
+++ lib/matplotlib/__init__.py (working copy)
@@ -349,7 +349,7 @@
 if os.path.isdir(path): return path
 
 # py2exe zips pure python, so still need special check
- if (sys.platform=='win32' or sys.platform=='darwin') and sys.frozen:
+ if getattr(sys, 'frozen', None):
 path = os.path.join(os.path.split(sys.path[0])[0], 'matplotlibdata')
 if os.path.isdir(path): return path
 else:
See also: http://pythonmac.org/wiki/FAQ#head-fda52eabc4c64a21d7044d62a49319a7c85faca9
The reason I ran into this was that I installed the svn version with
"setupegg.py develop"1, and there is no mpl-data directory in
lib/matplotlib. I made a symlink to an existing mpl-data directory,
but I wonder if there is some more elegant way for matplotlib to
support setuptools' develop mode?
1 http://mail.python.org/pipermail/distutils-sig/2005-July/004692.html
-- 
Jouni
From: Ted D. <ted...@jp...> - 2006年03月19日 18:46:44
John,
It might be nice if we could add a "what if" type function to all the 
backends for text sizing. That way we could write much better auto-layout 
algorithms for the axis and legend code. A very simple improvement to the 
auto-date labeller would then work like this:
- Find min, max values of the time axis
- Convert to the label format using the date formatter
- Ask the backend what the size of the min/max labels would be
- Take the max of that as a reasonable guess for the date label size
- Divide up the total interval (in pixels) by the label size + pad
- Pick nice ticks based on the total time interval and number of ticks you 
can fit
This would be really handy for us in that we do a lot of date plotting with 
widely varying time ranges and it would be nice to have an "auto-ticker" 
that insures the labels don't overlap for a plot of a given size and range.
On a scale of 1-10, how difficult do you think this type of thing would be 
to do?
Ted
At 07:52 PM 3/17/2006, John Hunter wrote:
> >>>>> "Michael" == Michael P Mossey <mo...@jp...> writes:
>
> Michael> Is there a way to find out in terms of pixels, points, or
> Michael> fraction of figure, how large a text string is? In other
> Michael> words if I generate "Some label" as the x-axis label, can
> Michael> I find out how tall and wide it is?
>
>It can be done -- it's not terribly elegant. The basic problem is
>that text size depends on the backend and configuration settings.
>Since we have arbitrary fonts, multiline text with arbitrary rotation,
>possible using TeX to render, with multiple output targets that might
>handle text differently, you can see how this seemingly simple
>question is actually tough.
>
>All text instances have a method called "get_window_extent" which
>returns a matplotlib.transforms.BBox that bounds the text instance.
>This bbox is in pixel coords.
>
> bbox = sometext.get_window_extent()
> l,b,w,h = bbox.get_bounds() # left, bottom, width, height
>
>
>Here's the rub: we can't realistically know the text size until we
>have a renderer, because the same text may be different in different
>renderers. matplotlib sets the figure renderer at draw time, and so
>by default we don't know the text size until draw size. This is
>sometimes cumbersome.
>
>One solution is to do something like
>
> plot(something)
> sometext = text(x,y,s)
> draw() # force a draw to set the renderer
> l,b,w,h = sometext.get_window_extent().get_bounds()
> ..adjust the postion of some objects based on this info
> ...draw again
>
>not terribly elegant because we must redraw. If you did not first
>force the draw command before calling get_window_extent, you would get
>an exception about needing to first set the renderer.
>
>Another approach if you want to avoid the duplicate drawing is to
>create a proxy renderer and pass that off to the text instance.
>
> l,b,w,h = fig.bbox.get_bounds()
> renderer = RendererAgg(w, h, fig.dpi)
> l,b,w,h = sometext.get_window_extent(renderer).get_bounds()
>
>This is not ideal either because you have a duplicate renderer.
>
>If you are using a *Agg backend and have a figure instance, you can do
>the following, which requires no duplicate drawing and no duplicate
>renderer (the get_renderer method below caches the return value so
>repeated calls do not create duplicate renderers)
>
>Here is a complete example
>
> from matplotlib.patches import Rectangle
> from matplotlib.transforms import identity_transform
> from pylab import figure, show
>
> fig = figure()
> ax = fig.add_subplot(111)
> ax.plot([1,2,3,4], [1,2,3,4])
> t = ax.text(2,2,'Look Ma!\nNo hands', fontsize=40, rotation=-45)
> renderer = fig.canvas.get_renderer()
> bbox = t.get_window_extent(renderer)
> l,b,w,h = bbox.get_bounds()
>
> # no transformation necessary, already in pixel coords
> r = Rectangle((l,b),w,h, transform=identity_transform())
> ax.add_patch(r)
> show()
>
>If we made the get_renderer method standard across backends, we could
>probably hide the get_renderer call from the user and make this a
>little more friendly, but the above should suffice. Note if you have
>some data in pixel coords, you can transform it into another
>coordinate system (eg data coords) using the inverse transform
>methods. The l,b,w,h bounding box of the text bbox in "data"
>coordinates (ie, the coords of the [1,2,3,4] plot) can be obtained
>with
>
> from matplotlib.transforms import inverse_transform_bbox
> databbox = inverse_transform_bbox(ax.transData, bbox)
> print databbox.get_bounds()
>
>In general, different coordinate systems in matplotlib communicate
>with one another by transforming a data point to pixel space and then
>inverse transforming that point into a different own space. There are
>two inverse methods to help with these tasks. The first is a
>transform method to handle single points:
>
> # apply the inverse transformation to tuple xy
> xi, yi = trans.inverse_xy_tup(xy)
>
>and the second is a stand-alone function defined in
>matplotlib.transforms to handle bboxes
>
> # apply the inverse transformation of a bbox
> bboxi = inverse_transform_bbox(trans, bbox)
>
>
>You might be thinking: why aren't we simply using an affine
>transformation matrix with a standard matrix inverse? All I can offer
>in response is that this architecture supports nonlinear
>transformations, ie, an affine plus a nonlinear transformation, for
>polar, log, etc.... There is probably a better way, but this is what
>we've got.
>
>JDH
>
>
>
>
>-------------------------------------------------------
>This SF.Net email is sponsored by xPML, a groundbreaking scripting language
>that extends applications into web and mobile media. Attend the live webcast
>and join the prime developer group breaking into this new coding territory!
>http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
>_______________________________________________
>Matplotlib-users mailing list
>Mat...@li...
>https://lists.sourceforge.net/lists/listinfo/matplotlib-users
From: mame l. <mam...@gm...> - 2006年03月18日 20:40:41
TmV2ZXIgbWluZCA6IEkgdHJpZWQgdW5pbnN0YWxsIG5ld2VyIHZlcnNpb24gYW5kIHJlaW5zdGFs
bGluZyBvbGQgTnVtZXJpYwphbmQgaXQgd29ya2VkCgpPbiAzLzE4LzA2LCBtYW1lIGxvdWsgPG1h
bWVsb3VrQGdtYWlsLmNvbT4gd3JvdGU6Cj4KPiBIaSBldmVyeW9uZSwKPgo+IEkgdHJpZWQgdG8g
aW5zdGFsbCBtYXRwbG90bGliIGZvciB1c2Ugd2l0aCBOZXR3b3JrWCwgYnV0IEkgZ290IHRoaXMg
ZXJyb3IKPgo+IGltcG9ydCBweWxhYiAtPgo+Cj4gVHJhY2ViYWNrIChtb3N0IHJlY2VudCBjYWxs
IGxhc3QpOgo+IDwuLi4+Cj4gICBGaWxlICJDOlxQcm9ncmFtCj4gRmlsZXNcUHl0aG9uMjRcTGli
XHNpdGUtcGFja2FnZXNcbWF0cGxvdGxpYlxudW1lcml4XF9faW5pdF9fLnB5IiwgbGluZSA2MCwK
PiBpbiA/Cj4gICAgIGZyb20gTnVtZXJpYyBpbXBvcnQgKgo+IEltcG9ydEVycm9yOiBObyBtb2R1
bGUgbmFtZWQgTnVtZXJpYwo+Cj4KPiBJJ3ZlIHNlZW4gdGhhdCBOdW1lcmljIHdhcyByZWNlbnRs
eSBjaGFuZ2VkIHRvIE51bXB5LCBJJ3ZlIHRyaWVkIHRvCj4gaW5zdGFsbCBhIGxvdCBvZiBwYWNr
YWdlcyBidXQgaXQgc3RpbGwgZG9uJ3Qgd29yay4KPgo+IERvZXMgYW55b25lIGFscmVhZHkgaGF2
ZSB0aGlzIHByb2JsZW0gPwo+Cj4gVGhhbmtzLAo+Cj4K
From: Darren D. <dd...@co...> - 2006年03月18日 20:30:34
On Saturday 18 March 2006 3:16 pm, mame louk wrote:
> Hi everyone,
>
> I tried to install matplotlib for use with NetworkX, but I got this error
>
> import pylab ->
>
> Traceback (most recent call last):
> <...>
> File "C:\Program
> Files\Python24\Lib\site-packages\matplotlib\numerix\__init__.py", line 60,
> in ?
> from Numeric import *
> ImportError: No module named Numeric
>
>
> I've seen that Numeric was recently changed to Numpy, I've tried to install
> a lot of packages but it still don't work.
If you have not installed Numeric, but you have installed numpy, you have two 
options:
1) Install Numeric
2) Change your numerix rc setting to numpy (see 
http://matplotlib.sourceforge.net/matplotlibrc for more information)
Hope this helps,
Darren
From: mame l. <mam...@gm...> - 2006年03月18日 20:16:25
SGkgZXZlcnlvbmUsCgpJIHRyaWVkIHRvIGluc3RhbGwgbWF0cGxvdGxpYiBmb3IgdXNlIHdpdGgg
TmV0d29ya1gsIGJ1dCBJIGdvdCB0aGlzIGVycm9yCgppbXBvcnQgcHlsYWIgLT4KClRyYWNlYmFj
ayAobW9zdCByZWNlbnQgY2FsbCBsYXN0KToKPC4uLj4KICBGaWxlICJDOlxQcm9ncmFtCkZpbGVz
XFB5dGhvbjI0XExpYlxzaXRlLXBhY2thZ2VzXG1hdHBsb3RsaWJcbnVtZXJpeFxfX2luaXRfXy5w
eSIsIGxpbmUgNjAsCmluID8KICAgIGZyb20gTnVtZXJpYyBpbXBvcnQgKgpJbXBvcnRFcnJvcjog
Tm8gbW9kdWxlIG5hbWVkIE51bWVyaWMKCgpJJ3ZlIHNlZW4gdGhhdCBOdW1lcmljIHdhcyByZWNl
bnRseSBjaGFuZ2VkIHRvIE51bXB5LCBJJ3ZlIHRyaWVkIHRvIGluc3RhbGwKYSBsb3Qgb2YgcGFj
a2FnZXMgYnV0IGl0IHN0aWxsIGRvbid0IHdvcmsuCgpEb2VzIGFueW9uZSBhbHJlYWR5IGhhdmUg
dGhpcyBwcm9ibGVtID8KClRoYW5rcywK
From: Robert K. <rob...@gm...> - 2006年03月18日 18:11:36
ahmet nurlu wrote:
> Hi,
> I wrote a random walk program which you will find below. When I run it
> from the terminal, it gives error which I am not able to figure out what
> could be wrong. From the bash shell, I give a command
> >python2.4 random.py
> It gives error:
> -----------------------------------------------------------------------------------------
> Traceback (most recent call last):
> File "random.py", line 2, in ?
> from pylab import *
> File "/usr/lib/python2.4/site-packages/pylab.py", line 1, in ?
> from matplotlib.pylab import *
> File "/usr/lib/python2.4/site-packages/matplotlib/pylab.py", line 196,
> in ?
> import mlab #so I can override hist, psd, etc...
> File "/usr/lib/python2.4/site-packages/matplotlib/mlab.py", line 58, in ?
> import sys, random
> File "/home/ofenerci/workspace/random.py", line 11, in ?
> if (rand() > 0.5):
> NameError: name 'rand' is not defined
> [3] Done gedit random.py
> -------------------------------------------------------------------------------------------------------------
> When I write the program step by step inside the python shell or run it
> inside the python-idle, everything goes smoothly and it doesn't give any
> error. I don't know why gives error, If I run it from the terminal.
Python always searches the current directory for modules first. You have named
your file random.py which is the same as the standard library module random.py.
matplotlib.mlab is trying to import the standard library module, but is getting
your instead.
Rename your file to something other than random.py.
-- 
Robert Kern
rob...@gm...
"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: ahmet n. <ahm...@ya...> - 2006年03月18日 09:31:32
Hi,
I wrote a random walk program which you will find below. When I run it from the terminal, it gives error which I am not able to figure out what could be wrong. From the bash shell, I give a command 
 >python2.4 random.py
It gives error:
-----------------------------------------------------------------------------------------
 Traceback (most recent call last):
 File "random.py", line 2, in ?
 from pylab import *
 File "/usr/lib/python2.4/site-packages/pylab.py", line 1, in ?
 from matplotlib.pylab import *
 File "/usr/lib/python2.4/site-packages/matplotlib/pylab.py", line 196, in ?
 import mlab #so I can override hist, psd, etc...
 File "/usr/lib/python2.4/site-packages/matplotlib/mlab.py", line 58, in ?
 import sys, random
 File "/home/ofenerci/workspace/random.py", line 11, in ?
 if (rand() > 0.5):
NameError: name 'rand' is not defined
[3] Done gedit random.py
-------------------------------------------------------------------------------------------------------------
When I write the program step by step inside the python shell or run it inside the python-idle, everything goes smoothly and it doesn't give any error. I don't know why gives error, If I run it from the terminal.
thanks,
Ahmet Nurlu
Random.py Program:
---------------------------------------------------------------------------
from pylab import *
npts=1000
nplot=10
for i in range(0,nplot):
 
 xplot=[]
 x=0.0
 for i in range(0,npts):
 if (rand() > 0.5):
 x=x+1
 else:
 x=x-1
 xplot.append(x)
 plot(xplot,'g')
 hold(True)
show()
-------------------------------------------------------------------------
		
---------------------------------
Relax. Yahoo! Mail virus scanning helps detect nasty viruses!
From: John H. <jdh...@ac...> - 2006年03月18日 03:53:56
>>>>> "Michael" == Michael P Mossey <mo...@jp...> writes:
 Michael> Is there a way to find out in terms of pixels, points, or
 Michael> fraction of figure, how large a text string is? In other
 Michael> words if I generate "Some label" as the x-axis label, can
 Michael> I find out how tall and wide it is?
It can be done -- it's not terribly elegant. The basic problem is
that text size depends on the backend and configuration settings.
Since we have arbitrary fonts, multiline text with arbitrary rotation,
possible using TeX to render, with multiple output targets that might
handle text differently, you can see how this seemingly simple
question is actually tough.
All text instances have a method called "get_window_extent" which
returns a matplotlib.transforms.BBox that bounds the text instance.
This bbox is in pixel coords.
 bbox = sometext.get_window_extent()
 l,b,w,h = bbox.get_bounds() # left, bottom, width, height
Here's the rub: we can't realistically know the text size until we
have a renderer, because the same text may be different in different
renderers. matplotlib sets the figure renderer at draw time, and so
by default we don't know the text size until draw size. This is
sometimes cumbersome.
One solution is to do something like
 plot(something)
 sometext = text(x,y,s)
 draw() # force a draw to set the renderer
 l,b,w,h = sometext.get_window_extent().get_bounds()
 ..adjust the postion of some objects based on this info
 ...draw again
not terribly elegant because we must redraw. If you did not first
force the draw command before calling get_window_extent, you would get
an exception about needing to first set the renderer.
Another approach if you want to avoid the duplicate drawing is to
create a proxy renderer and pass that off to the text instance.
 l,b,w,h = fig.bbox.get_bounds()
 renderer = RendererAgg(w, h, fig.dpi)
 l,b,w,h = sometext.get_window_extent(renderer).get_bounds()
 
This is not ideal either because you have a duplicate renderer.
If you are using a *Agg backend and have a figure instance, you can do
the following, which requires no duplicate drawing and no duplicate
renderer (the get_renderer method below caches the return value so
repeated calls do not create duplicate renderers)
Here is a complete example
 from matplotlib.patches import Rectangle
 from matplotlib.transforms import identity_transform
 from pylab import figure, show
 fig = figure()
 ax = fig.add_subplot(111)
 ax.plot([1,2,3,4], [1,2,3,4])
 t = ax.text(2,2,'Look Ma!\nNo hands', fontsize=40, rotation=-45)
 renderer = fig.canvas.get_renderer()
 bbox = t.get_window_extent(renderer)
 l,b,w,h = bbox.get_bounds()
 # no transformation necessary, already in pixel coords
 r = Rectangle((l,b),w,h, transform=identity_transform())
 ax.add_patch(r)
 show()
If we made the get_renderer method standard across backends, we could
probably hide the get_renderer call from the user and make this a
little more friendly, but the above should suffice. Note if you have
some data in pixel coords, you can transform it into another
coordinate system (eg data coords) using the inverse transform
methods. The l,b,w,h bounding box of the text bbox in "data"
coordinates (ie, the coords of the [1,2,3,4] plot) can be obtained
with
 from matplotlib.transforms import inverse_transform_bbox
 databbox = inverse_transform_bbox(ax.transData, bbox)
 print databbox.get_bounds()
In general, different coordinate systems in matplotlib communicate
with one another by transforming a data point to pixel space and then
inverse transforming that point into a different own space. There are
two inverse methods to help with these tasks. The first is a
transform method to handle single points:
 # apply the inverse transformation to tuple xy
 xi, yi = trans.inverse_xy_tup(xy) 
and the second is a stand-alone function defined in
matplotlib.transforms to handle bboxes
 # apply the inverse transformation of a bbox
 bboxi = inverse_transform_bbox(trans, bbox)
You might be thinking: why aren't we simply using an affine
transformation matrix with a standard matrix inverse? All I can offer
in response is that this architecture supports nonlinear
transformations, ie, an affine plus a nonlinear transformation, for
polar, log, etc.... There is probably a better way, but this is what
we've got.
JDH
From: Charlie M. <cw...@gm...> - 2006年03月18日 01:31:00
Are you using numarray as your numerix? If so, is it specified in
matplotlibrc of the exe bundle?
On 3/17/06, Daniel McQuillen <dan...@ya...> wrote:
> Daniel McQuillen <danmcquillen@...> writes:
>
> A follow up note from my posting today:
>
> Although the .exe was successfully created by py2exe,
> when I try to run it,I only get an "Errors Occurred"
> dialog window with the following written to the
> log:
>
> Traceback (most recent call last):
> File "VizTool.py", line 2, in ?
> File "VizTool\Controllers.pyo", line 4, in ?
> File "VizTool\GraphPanels.pyo", line 1, in ?
> File "wxmpl.pyo", line 32, in ?
> File "matplotlib\numerix\__init__.pyo", line 145, in ?
> ImportError: No module named random_array
>
> Here's my setup script. Note that I've included the
> line suggested by the py2exe wiki
> (http://starship.python.net/crew/theller/moin.cgi/MatPlotLib)
> to try to remedy this missing random_array module,
> but am still getting that error.
>
>
> import os
> from distutils.core import setup
> import py2exe
> import glob
>
> import matplotlib
>
> opts =3D {
> 'py2exe': { 'includes': 'matplotlib.numerix.random_array',
> 'excludes': ['_gtkagg', '_tkagg'],
> 'dll_excludes': ['libgdk-win32-2.0-0.dll',
> 'libgobject-2.0-0.dll']
> }
> }
>
> setup( version =3D '0.0.1',
> windows =3D ['VizTool.py'],
> data_files =3D [('data', ['data/CH2.csv']),
> ('conf',['conf/GraphStyles.ini']),
> ('',['matplotlibrc']),
> matplotlib.get_py2exe_datafiles()],
> options=3D{"py2exe":{"optimize":2}},
> )
>
>
>
> This is the setup.py command at the DOST prompt:
>
> C:>python.exe -OO setup.py py2exe -b 3 -c -p numarray,pytz -e numpy
>
> Thanks for any help anybody can provide!
>
> Regards,
>
> Daniel McQuillen
> Oakland, CA
>
>
>
>
>
>
>
>
>
>
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by xPML, a groundbreaking scripting langua=
ge
> that extends applications into web and mobile media. Attend the live webc=
ast
> and join the prime developer group breaking into this new coding territor=
y!
> http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=3D110944&bid=3D241720&dat=
=3D121642
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
From: Charlie M. <cw...@gm...> - 2006年03月18日 01:29:33
I fixed the matplotlib references. I must have been importing it in
my script. Thanks for the info.
- Charlie
On 3/17/06, Daniel McQuillen <dan...@ya...> wrote:
> Daniel McQuillen <daniel@...> writes:
>
>
> > Charlie Moad <cwmoad <at> ...> writes:
> >
> > >
> > > I just committed the changes to cvs and added a convenience function
> > > for py2exe called get_py2exe_datafiles.
> >
>
> Charlie,
>
> Thanks for your help. I tried running your script and got an error origin=
ating
> from the function you wrote within __init__.py. I tried the function by i=
tself
> within PyShell and got the same error...here's the error I received:
>
> File "setup.py", line 23, in ?
> data_files =3D [('', ['nlo.gif', '../vtkrotate/NMA.pdb']),
> File "C:\Python24\Lib\site-packages\matplotlib\__init__.py", line 367, =
in get_
> py2exe_datafiles
> mplfiles =3D glob.glob(os.sep.join([matplotlib.get_data_path(), '*'])=
)
> NameError: global name 'matplotlib' is not defined
>
>
> This seems to be the code that you added to the __init__.py file:
>
> def get_py2exe_datafiles():
> import glob
>
> mplfiles =3D glob.glob(os.sep.join([matplotlib.get_data_path(), '*'=
]))
> # Need to explicitly remove cocoa_agg files or py2exe complains
> mplfiles.remove(os.sep.join([matplotlib.get_data_path(), 'Matplotli=
b.nib']))
>
> return ('matplotlibdata', mplfiles)
>
> I removed the matplotlib references and the code then worked:
>
>
> def get_py2exe_datafiles():
> import glob
>
> mplfiles =3D glob.glob(os.sep.join([get_data_path(), '*']))
> # Need to explicitly remove cocoa_agg files or py2exe complains
> mplfiles.remove(os.sep.join([get_data_path(), 'Matplotlib.nib']))
>
> return ('matplotlibdata', mplfiles)
>
>
> I can now create an .exe. I'll post soon as to how well the .exe actually=
 works.
>
> Thanks for your help.
>
> Daniel
> Oakland, CA
>
>
>
>
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by xPML, a groundbreaking scripting langua=
ge
> that extends applications into web and mobile media. Attend the live webc=
ast
> and join the prime developer group breaking into this new coding territor=
y!
> http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=3D110944&bid=3D241720&dat=
=3D121642
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
From: Vidar G. <vid...@37...> - 2006年03月17日 22:08:46
===== Original message from Robert Hetland | 17 Mar 2006:
> I would check to make sure you installed freetype right..
a reinstall of freetype got things up and running again.
the freetype on my system probably had been corrupted.
From: Carol L. <car...@sr...> - 2006年03月17日 21:57:29
Supplying S as an argument instead of a keyword worked for fixing the 
size, but I lost the arrow heads.
Any suggestions?
> quiver()'s argument handling is very fragile. You can't use keyword arguments.
> If you want to use the S argument you have to invoke quiver() like so:
> 
> quiver(X, Y, U, V, S)
> 
-- 
Ms. Carol A. Leger
SRI International			Phone: (650) 859-4114
333 Ravenswood Avenue G-273
Menlo Park, CA 94025 e-mail: le...@sr...
From: Daniel M. <dan...@ya...> - 2006年03月17日 21:39:20
Daniel McQuillen <danmcquillen@...> writes:
A follow up note from my posting today:
Although the .exe was successfully created by py2exe, 
when I try to run it,I only get an "Errors Occurred" 
dialog window with the following written to the
log:
Traceback (most recent call last):
 File "VizTool.py", line 2, in ?
 File "VizTool\Controllers.pyo", line 4, in ?
 File "VizTool\GraphPanels.pyo", line 1, in ?
 File "wxmpl.pyo", line 32, in ?
 File "matplotlib\numerix\__init__.pyo", line 145, in ?
ImportError: No module named random_array
Here's my setup script. Note that I've included the 
line suggested by the py2exe wiki
(http://starship.python.net/crew/theller/moin.cgi/MatPlotLib)
to try to remedy this missing random_array module, 
but am still getting that error.
import os
from distutils.core import setup
import py2exe
import glob
import matplotlib
opts = {
 'py2exe': { 'includes': 'matplotlib.numerix.random_array',
 'excludes': ['_gtkagg', '_tkagg'],
 'dll_excludes': ['libgdk-win32-2.0-0.dll',
 'libgobject-2.0-0.dll']
 }
 }
 
setup( version = '0.0.1',
 windows = ['VizTool.py'], 
 data_files = [('data', ['data/CH2.csv']),
 ('conf',['conf/GraphStyles.ini']),
 ('',['matplotlibrc']),
 matplotlib.get_py2exe_datafiles()],
 options={"py2exe":{"optimize":2}},
)
This is the setup.py command at the DOST prompt:
C:>python.exe -OO setup.py py2exe -b 3 -c -p numarray,pytz -e numpy 
Thanks for any help anybody can provide!
Regards,
Daniel McQuillen
Oakland, CA
From: Steve S. <el...@gm...> - 2006年03月17日 21:12:19
John Hunter wrote:
>>>>>>"Steve" == Steve Schmerler <el...@gm...> writes:
> 
> 
> Steve> sorry forgot to attach the files :)
> 
> OK< after a quick look here is a new approach to think about. After
> you install and run 0.82, and then build 0.87.x, you did not flush the
> font cache or tex cache dir, right? In this case the font caching
> mechanism may be picking up the old font dir look for 'font search
> path' in your logs. What happens if you first install 0.82, run it,
> then install 0.87, run it, then flush the font and tex cache. Does 87
> then fail as before. Ie is it the running of 0.82 and the
> preservation of the font cache information that is causing 0.87 to
> work? Arguing against this is that findfont seems to be returning
> Vera.ttf in both cases.
> 
> In any case, an important clue would be to know whether wiping out
> ~/.matplotlib/*.cache restores the bug in 0.87.x
> 
No. I removed
elcorto@ramrod:~$ rm -r .matplotlib/tex.cache/ .matplotlib/ttffont.cache 
.ttffont.cache
and ran the script. It doesn't fail. Note that I still had a 
.ttffont.cache (from 0.82) in my $HOME (because I did not remove 
*anything* related to 0.82 before building 0.87.2). But even removing 
this doesn't change anything.
Does mpl (0.87.2) maybe include 0.82 stuff during the build process?
cheers,
steve
ps: I always get your mails twice :)
-- 
Random number generation is the art of producing pure gibberish as 
quickly as possible.
From: Daniel M. <dan...@ya...> - 2006年03月17日 21:10:35
Daniel McQuillen <daniel@...> writes:
> Charlie Moad <cwmoad <at> ...> writes:
> 
> > 
> > I just committed the changes to cvs and added a convenience function
> > for py2exe called get_py2exe_datafiles. 
> 
Charlie, 
Thanks for your help. I tried running your script and got an error originating
from the function you wrote within __init__.py. I tried the function by itself
within PyShell and got the same error...here's the error I received:
 File "setup.py", line 23, in ?
 data_files = [('', ['nlo.gif', '../vtkrotate/NMA.pdb']),
 File "C:\Python24\Lib\site-packages\matplotlib\__init__.py", line 367, in get_
py2exe_datafiles
 mplfiles = glob.glob(os.sep.join([matplotlib.get_data_path(), '*']))
NameError: global name 'matplotlib' is not defined
This seems to be the code that you added to the __init__.py file:
 def get_py2exe_datafiles():
 import glob
 
 mplfiles = glob.glob(os.sep.join([matplotlib.get_data_path(), '*']))
 # Need to explicitly remove cocoa_agg files or py2exe complains
 mplfiles.remove(os.sep.join([matplotlib.get_data_path(), 'Matplotlib.nib']))
 
 return ('matplotlibdata', mplfiles)
I removed the matplotlib references and the code then worked:
 def get_py2exe_datafiles():
 import glob
 
 mplfiles = glob.glob(os.sep.join([get_data_path(), '*']))
 # Need to explicitly remove cocoa_agg files or py2exe complains
 mplfiles.remove(os.sep.join([get_data_path(), 'Matplotlib.nib']))
 
 return ('matplotlibdata', mplfiles)
I can now create an .exe. I'll post soon as to how well the .exe actually works.
Thanks for your help.
Daniel
Oakland, CA
From: John H. <jdh...@ac...> - 2006年03月17日 20:56:10
>>>>> "Steve" == Steve Schmerler <el...@gm...> writes:
 Steve> sorry forgot to attach the files :)
OK< after a quick look here is a new approach to think about. After
you install and run 0.82, and then build 0.87.x, you did not flush the
font cache or tex cache dir, right? In this case the font caching
mechanism may be picking up the old font dir look for 'font search
path' in your logs. What happens if you first install 0.82, run it,
then install 0.87, run it, then flush the font and tex cache. Does 87
then fail as before. Ie is it the running of 0.82 and the
preservation of the font cache information that is causing 0.87 to
work? Arguing against this is that findfont seems to be returning
Vera.ttf in both cases.
In any case, an important clue would be to know whether wiping out
~/.matplotlib/*.cache restores the bug in 0.87.x
JDH
5 messages has been excluded from this view by a project administrator.

Showing results of 398

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