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

Showing results of 284

<< < 1 .. 6 7 8 9 10 .. 12 > >> (Page 8 of 12)
From: Eric F. <ef...@ha...> - 2005年04月12日 19:13:17
John,
Attached are a slightly modified lines.py, based on CVS download this 
morning, and a demo of plotting masked arrays.
The changes to lines.py are:
1) additional function imports from numerix
2) importing numerix.ma
3) a new function at the top of the file, unmasked_index_ranges.
4) changes to the draw and set_data methods
5) docstring indentation
I think that with these fairly small changes, the plot command (or 
anything that uses Line2D to make lines or sets of markers) will work 
exactly the same as before with unmasked data, and will work correctly 
with masked data. That is, only the valid points will be plotted, and 
lines will be broken at gaps.
I went for the simplest and least-intrusive changes I could find; maybe 
drawing the line segments could be improved by using the line collection 
renderer instead of a loop over ordinary line segments. It could also 
be optimized by not plotting line segments (as opposed to markers) when 
there is only one point. Let me know if you want me to look into any of 
these things; for now, I just wanted to get something working.
The unmasked_index_ranges function, or some variation of it, might be 
useful outside lines.py. There are many ways it could be altered. I 
chose the 2-D array return, as opposed to a sequence of tuples, or a 
pair of 1-D arrays, in the hopes that it would be clear, efficient, and 
flexible; for example, it makes calculation of line segment lengths 
doable with a single "diff".
In lines 263,264 of lines.py I put a question, not directly relevant to 
the changes I made, but pointing to what may be a minor oversight.
I hope I haven't overlooked anything major!
If all this is going in the right direction, I will add masked array 
support to contour.py later this week. It should be trivial. I would 
then be inclined to remove the "experimental" kwarg, badmask.
Finding the bug in filled contours with masking remains to be done.
Eric
From: John H. <jdh...@ac...> - 2005年04月12日 16:05:31
Every once in a while, when enough new features have been added and
the nasty bugs ironed out, I tick the major version number and post a
matplotlib release to the general python commuity. These releases are
really just bug fix releases of the last release in disguise :-)
I just uploaded matplotlib-0.80 to the web site. If you folks could
be kind enough to give this a test drive and let me know if you hit
any snags, I'd be much obliged. If all goes well, I'll do the general
release tomorrow.
What's new in 0.80
kwargs to xlim, ylim, axis
 Applied a variant of Rick Muller's xlim/ylim/axis patch. These
 functions now take kwargs to let you selectively alter only the min
 or max if desired. Eg xlim(xmin=2) or axis(ymax=3). They always
 return the new lim. See, eg help(xlim). The same functionality is
 available in the API with ax.set_xlim and ax.set_ylim .
wx fixes
 Fixed a problem with wx app instantiation. Incorporated Werner's wx
 patch -- wx backend should be compatible with wxpython 2.4 and
 recent versions of 2.5. Some early versions of wxpython 2.5 will not
 work because there was a temporary change in the dc API that was
 rolled back to make it 2.4 compliant
Polygon editors
 Added some proof of concept code to show how to use matplotlib to
 interact with plot elements in a GUI neutral way. The editable
 polygon allows you to insert, delete and move vertices. See
 examples/poly_editor.py. The idea it to add interactor classes to
 support editable lines, text, polygons, etc. This could support a
 cross GUI colormap editor, or spline editor, for example.
http://matplotlib.sf.net
Thanks!
JDH
From: Werner F. B. <wer...@fr...> - 2005年04月12日 15:54:09
Attachments: pylab.py
Hi John,
Changing in pylab.py all the .__doc__ where either __doc__ + (only 1) or 
_shift_string (40 lines) is used to something along these lines:
if not Axes.axhline.__doc__ == None:
 axhline.__doc__ = _shift_string(Axes.axhline.__doc__) + """
 Addition kwargs: hold = [True|False] overrides default hold state"""
This allows to use the py2exe/Python "Optimize: 2" option again and 
still have documentation available.
Just tested it with the simple_plot_wxagg sample.
See you
Werner
P.S. Attached the file for your perusal.
From: Michael T. <mic...@gm...> - 2005年04月12日 15:50:04
On Apr 12, 2005 3:13 PM, John Hunter <jdh...@ac...> wrote:
> I saw the exact same thing but it appeared to come and go as I made
> minor tweaks to the setup, and could never figure out why I sometimes
> got this error and sometimes did not. I added nummaray to the
> packages list.
> 
I've googled on this but never found anything definitive. It'd be good
if someone figured out what's happening as it's a fairly nasty error,
but it's just easier to remember to stick that package in the packages
list.
> Yep, this is mentioned in the comment header of setup.py for the gtk
> example (and in the FAQ). Still, it's easy to miss, as I spent about
> 15 minutes trying to figure out what was going wrong (it had been many
> months since I wrote the example) before I read my own comment. I
> added a print reminder to setup.py.
> 
(cough) Continuing my fine tradition of missing the helpful bits in
documentation and comments.
> Curious to know if this works for Andrea too. It appears to work for
> me with py2exe 0.5.4
> 
I hope this works as it makes life a lot easier all round. If it
doesn't I'd definitely suspect a bug in py2exe.
> Michael> I've attached a diff showing the minor modifications I
> Michael> made.
> 
> Thanks, I've updated the examples on the site.
> 
> I also saw your comment on the py2exe matplotlib wiki. I changed the
> init method slightly -- could you test this on your setup to make sure
> it works
> 
Oh yeah, I'd forgotten about that wiki comment completely.
I'll test the changed code this afternoon, thanks.
cheers,
 Michael
From: John H. <jdh...@ac...> - 2005年04月12日 15:29:36
>>>>> "Sajec," == Sajec, Mike TQO <ms...@tq...> writes:
 Sajec,> Is there a simple way to grab x,y coordinates from active
 Sajec,> plot in a manner similar to using matlab's ginput()
 Sajec,> function?
It depends on what you mean by simple :-)
matplotlib provides a GUI independent way to capture basic events, eg
to get the mouse coordinates in screen and data units and button
clicks, key presses, etc.
See http://matplotlib.sourceforge.net/tutorial.html#events
Some people do not find callbacks intuitive. If you are one of these
people, you might try something like the following
from pylab import *
class MouseMonitor:
 event = None
 def __call__(self, event):
 self.event = event
mouse = MouseMonitor()
connect('button_press_event', mouse)
plot([1,2,3])
Now you can click on the plot, and get the coords like so
print mouse.event.xdata, mouse.event.ydata
See
http://matplotlib.sourceforge.net/matplotlib.backend_bases.html#MouseEvent
for more information on the mouse event attributes
There are a couple of demos for event handling
 examples/keypress_demo.py
 examples/coords_demo.py
JDH
From: <na...@te...> - 2005年04月12日 15:24:53
Greetings,
Matplotlib has been helping me a lot, as always. I post so
infrequently to this group because I usually don't have any
problem getting what I want. However, I think I found a bug
in stem.
I've been stressing the stem function a lot, since I deal
with signal processing. When plotting a demonstration of the
overlap and save method (for performing long convolutions),
I got something unexpected which the script below reproduces:
---
from matplotlib.pylab import *
n = arange(0, 2*pi, 2*pi/50, Float)
x = sin(n)
figure(1)
stem(n, x, "k-", "ko", "k-")
x[:26] = 0
savefig("test.eps")
---
The sequence is plotted almost without any problems: the
vertical lines are drawn with the correct amplitudes, but,
because of the setting of some values of x to 0, the markers
"fall down" to the axes. If I couldn't make myself clear, I
can send an image of the result, but I think the script can
reproduce the problem. I'm using the latest version of
matplotlib, downloaded and installed yesterday.
As it turns out, it actually *helped* me. Overlapp and save
method consists in discarding some samples of the result. I
couldn't think of a good way to actually show in a single
figure how it would be done. I mention the bug, if it is really
a bug, and not me doing something wrong, only to report it. I
have no hurry to see it fixed - in fact, as it helped me, I
don't plan to have it fixed soon. But I thought the developers
would like to know it.
Also, I would like to know if there is any way to customize
the markers. There are some figures I need to make where the
markers should be arrows pointing up. I modified "^" to look
like what I wanted, but probably there is a better way to do
that.
Thanks in advance
---
José Alexandre Nalon
na...@te...
From: John H. <jdh...@ac...> - 2005年04月12日 15:09:19
>>>>> "Werner" == Werner F Bruhin <wer...@fr...> writes:
 Werner> I am looking at the py2exe optimize problem, would be nice
 Werner> if this could be fixed somehow too.
The basic problem is that pylab wrapper functions get their docstrings
from the respective Axes or Figure functions that they wrap, and then
they add a bit of pylab specific documentation at the end. Most of
the pylab functions are generated by boilerplate.py, which is python
code to generate the pylab wrapper functions.
One solution to change boilerplate.py to embed the doc strings
manually in the pylab wrappers. Eg, instead of generating
plot.__doc__ = _shift_string(Axes.plot.__doc__) + """
Addition kwargs: hold = [True|False] overrides default hold state"""
Actually embed the Axes.plot.__doc__ directly.
This should work with py2exe optimize.
JDH
From: Werner F. B. <wer...@fr...> - 2005年04月12日 15:01:21
Hi John,
John Hunter wrote:
>>>>>>"Werner" == Werner F Bruhin <wer...@fr...> writes:
>>>>>> 
>>>>>>
>
> Werner> Which example file are you using were you see a
> Werner> difference?
>
>It appears to be a problem with pylab scripts, eg
>
> > python2.3 examples/simple_plot.py -dWXAgg
>
>I am pretty sure this is a 2.4 versus 2.5 problem. I installed wx 2.4
>in my python2.4 tree and 2.5 in my python2.3 tree and find that the
>size was wrong only on wx2.4.
>
>This was also true for matplotlib-0.74 and CVS which includes your
>patch, so it is not something that was caused by your patch, but it is
>a bug.
>
>Since it only occurred for pylab mode and not apps, I poked around the
>embedding examples to see what the difference was, and found that the
>embedding examples passed the size kwarg to the wx.Frame.__init__
>function.
>
>So I added these lines to FigureFrameWx
>
>class FigureFrameWx(wx.Frame):
> def __init__(self, num, fig):
> ...snip...
> l,b,w,h = fig.bbox.get_bounds()
> wx.Frame.__init__(self, parent=None, id=-1, pos=pos,
> title="Figure %d" % num,
> size=(w,h))
>
>
>
>which appears to work for wx2.4 and 2.5.
>
>So I think all the known problems with wx are fixed for now.
> 
>
Great.
I am looking at the py2exe optimize problem, would be nice if this could 
be fixed somehow too.
See you
Werner
>JDH
>
>
>
> 
>
From: John H. <jdh...@ac...> - 2005年04月12日 14:46:22
>>>>> "Werner" == Werner F Bruhin <wer...@fr...> writes:
 Werner> Which example file are you using were you see a
 Werner> difference?
It appears to be a problem with pylab scripts, eg
 > python2.3 examples/simple_plot.py -dWXAgg
I am pretty sure this is a 2.4 versus 2.5 problem. I installed wx 2.4
in my python2.4 tree and 2.5 in my python2.3 tree and find that the
size was wrong only on wx2.4.
This was also true for matplotlib-0.74 and CVS which includes your
patch, so it is not something that was caused by your patch, but it is
a bug.
Since it only occurred for pylab mode and not apps, I poked around the
embedding examples to see what the difference was, and found that the
embedding examples passed the size kwarg to the wx.Frame.__init__
function.
So I added these lines to FigureFrameWx
class FigureFrameWx(wx.Frame):
 def __init__(self, num, fig):
 ...snip...
 l,b,w,h = fig.bbox.get_bounds()
 wx.Frame.__init__(self, parent=None, id=-1, pos=pos,
 title="Figure %d" % num,
 size=(w,h))
which appears to work for wx2.4 and 2.5.
So I think all the known problems with wx are fixed for now.
JDH
From: <and...@ti...> - 2005年04月12日 14:33:09
Hello NG,
>Curious to know if this works for Andrea too. It appears to work for
>me with py2exe 0.5.4
Yes, the simple plot example works on my machine (Windows 2000, py2exe 0.=
5.4,
Matplotlib 0.74, wxPython 2.5.5.1). I don't know if it will work also for=
my big application, but I will try as soon as I can, and I don't see any
particular reason for which it should not run.
Thanks, however, for all the work you are doing!
Andrea.
From: Werner F. B. <wer...@fr...> - 2005年04月12日 14:25:35
Hi John,
I actually think that the OnPaint event in embedding_in_wx is not needed 
at all.
See you
Werner
Werner F. Bruhin wrote:
> Hi John,
> 
> Werner F. Bruhin wrote:
> 
>> Hi John,
>>
>> John Hunter wrote:
>>
>>>>>>>> "Werner" == Werner F Bruhin 
>>>>>>>> <wer...@fr...> writes:
>>>
>>>
>>>
>>>
>>>
>>> Werner> By doing this I found a few more oversights (wx to wx.) in
>>> Werner> backend, updated version is attached.
>>>
>>> OK, I've got it working with wxpython 2.5.5.1
>>>
>>> The only glitch I've noticed so far is that the figsize parameter does
>>> not appear to be respected. The windows that are created a
>>> considerably smaller than they should be.
>>>
>>> Any ideas?
>>
>>
>> Just did a little test, copied back the originals for backend_wx and 
>> backend_wx_agg and run embedding_in_wx4 and the figure size in both 
>> cases is about 390x318.
>>
>> Which example file are you using were you see a difference?
>>
>> BTW, also noticed with the embedding_in_wx4 the CPU usage stays at 
>> 100% and I can't close it (at least not always) - again with original 
>> or modified code.
> 
> To correct the CPU usage change the OnPaint event to include an 
> event.Skip() as this:
> 
> def OnPaint(self, event):
> self.canvas.draw()
> event.Skip()
> 
> That also makes the toolbar show up correctly.
> 
> See you
> Werner
> 
>>
>>>
>>> JDH
>>>
>> See you
>> Werner
>>
>>>
>>> -------------------------------------------------------
>>> SF email is sponsored by - The IT Product Guide
>>> Read honest & candid reviews on hundreds of IT Products from real users.
>>> Discover which products truly live up to the hype. Start reading now.
>>> http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
>>
>>
>>
>>
>>
>>
>> -------------------------------------------------------
>> SF email is sponsored by - The IT Product Guide
>> Read honest & candid reviews on hundreds of IT Products from real users.
>> Discover which products truly live up to the hype. Start reading now.
>> http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
> 
> 
> 
> 
> -------------------------------------------------------
> SF email is sponsored by - The IT Product Guide
> Read honest & candid reviews on hundreds of IT Products from real users.
> Discover which products truly live up to the hype. Start reading now.
> http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
From: Werner F. B. <wer...@fr...> - 2005年04月12日 14:14:04
Hi Michael,
This is all I need:
Obviously the two first lines you need to adapt.
data = glob.glob(r'C:\Python24\share\matplotlib\*')
data.append(r'C:\Python24\share\matplotlib\.matplotlibrc')
setup(console=["simple_plot.py"],
 data_files=[("matplotlibdata",data)],
 options = {"py2exe": {"compressed": 1,
 # optimize breaks pylab docstring handling
 #"optimize": 2,
 "packages": ["encodings", "pytz"],
 }},
 )
Note that I use "packages" and NOT include, all the matplotlib and 
numeric stuff seems to get detected correctly by py2exe.
I am not even sure about encodings, but as I had problems with this 
before I just always put it there.
I see in your later post that you came to a similar conclusion.
See you
Werner
Michael Twomey wrote:
> Hi,
> 
> On Apr 11, 2005 6:02 PM, John Hunter <jdh...@ac...> wrote:
> 
>>>>>>>"andrea" == andrea gavana <and...@ti...> writes:
>>
>> andrea> I still get the TimeZone error...
>>
>>I spent a little time looking at this this morning. I found that I
>>needed to explicitly put the utc timezone in my script that I was
>>freezing, it was not enough to include it in my includes list. Oddly,
>>this was not consistent. In the simple_plot_wxagg example, I had the
>>timezone info in my includes list only and it worked w/o incident. In
>>the simple_plot_gtk example, I needed to manually add
>>
>>import pytz.zoneinfo.UTC
>>
>>to my simple_plot.py script. Strange...
>>
> 
> 
> For me I've found that I've needed to include every level of a given
> module individually to get it working, e.g. 'pytz', 'pytz.timezone'
> and 'pytz.timezone.UTC'. After that py2exe works for me.
> 
> This (to me) is an example of how stuff which dynamically imports
> modules at runtime trips up stuff like py2exe (I believe the py.test
> folks are losing a lot of hair over dynamic imports in their testing
> magic too). What I think is happening here (and in encodings) is that
> normal usage involves just importing the toplevel module in your app's
> code, and at runtime you invoke a call which then goes and imports the
> module supplying the code you need. So when py2exe analyses the code,
> it doesn't see your runtime import and misses the relevant module.
> 
> Adding an explicit import in your app should be pretty much the same
> as using a py2exe include, except that it introduces some overhead at
> runtime. To handle every timezone your would have to import every
> timezone in your app, whereas with py2exe's includes you just specify
> what to stick in the zip and the app can import just the timezone it
> needs at runtime. Theoretically anyway :)
> 
> To add fun to the mix, any package which dynamically imports stuff at
> runtime usually has to be careful to either be aware of how it lives
> in a zip when frozen, or not to do anything dependant on it's file
> path.
> 
> 
>>Also, what kinds of files should be in the includes list? For example,
>>in Michael's list, he includes
>>
>> "matplotlib._na_image",
>> "matplotlib._na_transforms",
>> "matplotlib._nc_image",
>> "matplotlib._nc_transforms",
>>
>>but not
>>
>> "matplotlib._image"
>> "matplotlib._transforms"
>>
>>The latter two are python files, the former extension code. Do you
>>typically need to manually point py2exe to the extension files?
>>
> 
> 
> I've found py2exe has given me difficulty when looking for extensions,
> so my list of includes represents partially extensions I've found to
> be missing in frozen apps when trying to run them and partially every
> other extension I've come across for good measure (since I was doing a
> build, crash, add missing extension loop, I decided to add them all).
> Depending on how apps and modules handle imports, py2exe seems to be
> able to pick up pure python stuff more easily than python extensions.
> 
> All this could be just a mix of my particular setup and the
> applications I deal with, no two people's py2exe problems ever seem to
> be the same :)
> 
> All the problems centre around py2exe's module finding logic, every
> problem I've encountered has been due to py2exe missing out on one or
> two modules (in particular ones which do very dynamic imports at run
> time as oppose to import time), so there is a lovely cargo cult feel
> to my includes list, I decided the five minutes of adding all the
> includes I might need from a given package was worth it, rather than
> the repeated half hour of tracking down people's problems when running
> the apps.
> 
> 
>>Anyway, the wxagg and gtk examples in the updated
>>http://matplotlib.sourceforge.net/py2exe_examples.zip build and run on
>>my machine. They are a bit of a hack in that I don't really
>>understand why/how/when the includes work. If someone can rationalize
>>these scripts, improve them, extend them, whatever, send the updates
>>my way.
>>
> 
> 
> I'll have a go with them and see how they fair under my esoteric
> setup. I'm going to bet that I'll have problems no one else does ;)
> 
> Michael
> 
> 
> -------------------------------------------------------
> SF email is sponsored by - The IT Product Guide
> Read honest & candid reviews on hundreds of IT Products from real users.
> Discover which products truly live up to the hype. Start reading now.
> http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
From: John H. <jdh...@ac...> - 2005年04月12日 14:13:03
>>>>> "Michael" == Michael Twomey <mic...@gm...> writes:
 Michael> C:\temp\py2exe\simple_plot_gtk\dist>date_demo.exe Fatal
 Michael> Python error: Call to API function without first calling
 Michael> import_libnumarra y() in Src\_convmodule.c
I saw the exact same thing but it appeared to come and go as I made
minor tweaks to the setup, and could never figure out why I sometimes
got this error and sometimes did not. I added nummaray to the
packages list.
 Michael> (I also had to copy in the lib and etc directories from
 Michael> my GTK install to keep GTK+ happy, since it needs
 Michael> supporting files and libraries, that's a pygtk/GTK+
 Michael> specific thing.)
Yep, this is mentioned in the comment header of setup.py for the gtk
example (and in the FAQ). Still, it's easy to miss, as I spent about
15 minutes trying to figure out what was going wrong (it had been many
months since I wrote the example) before I read my own comment. I
added a print reminder to setup.py.
 Michael> Even when I remove the pytz imports from the
 Michael> simple_plot_gtk scripts py2exe doesn't seem to have any
 Michael> problems, the pytz package include does the trick for me.
Curious to know if this works for Andrea too. It appears to work for
me with py2exe 0.5.4
 Michael> I've attached a diff showing the minor modifications I
 Michael> made.
Thanks, I've updated the examples on the site.
I also saw your comment on the py2exe matplotlib wiki. I changed the
init method slightly -- could you test this on your setup to make sure
it works
 if sys.platform=='win32' and sys.frozen: 
 path = os.path.join(os.path.split(sys.path[0])[0], 'matplotlibdata') 
 if os.path.isdir(path): return path 
 else:
 # Try again assuming sys.path[0] is a dir not a exe 
 path = os.path.join(sys.path[0], 'matplotlibdata') 
 if os.path.isdir(path): return path
 raise RuntimeError('Could not find the matplotlib data files')
Thanks,
JDH
From: Michael T. <mic...@gm...> - 2005年04月12日 12:53:35
Attachments: py2exe.diff
Well, after looking at the examples you'll be pleased to hear they
cleared up a fundamental misunderstanding I had with py2exe's
configuration. You won't be so pleased to hear that they blew up
dramatically and in an interesting new way (for me) when I tried to
run the frozen exes :)
I had been mixing up distutils' packages directive (which lists
packages in your source tree) and py2exe's 'packages' option (which
does what my lengthy includes do in one go with the package). Using
the packages directive leads to errors, 'packages' does what I
expected.
So you can pretty much ignore my includes, though I think my comments
about hand holding py2exe's module finding still stand.
Now, on to the problem:
C:\temp\py2exe\simple_plot_gtk\dist>date_demo.exe
Fatal Python error: Call to API function without first calling import_libnumarra
y() in Src\_convmodule.c
This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.
If I add numarray to the packages list it works fine for me.
(I also had to copy in the lib and etc directories from my GTK install
to keep GTK+ happy, since it needs supporting files and libraries,
that's a pygtk/GTK+ specific thing.)
Even when I remove the pytz imports from the simple_plot_gtk scripts
py2exe doesn't seem to have any problems, the pytz package include
does the trick for me.
I've attached a diff showing the minor modifications I made.
The complete set of commands I used to build (under cygwin with
official python, not the cygwin python):
$ python.exe setup.py py2exe
$ cp -r /c/GTK/etc dist
$ cp -r /c/GTK/lib dist
$ ./dist/date_demo.exe
cheers,
 Michael
From: <oli...@ma...> - 2005年04月12日 12:28:28
John and Philippe,
thank you for your help. I have followed John's updated examples and now I
get an exe-file of my application. However, now I run into the same
timezone/UTC key error problems that was discussed the last few days on
this list.
As I understand the problem is not completely resolved yet, so I'll jsut
wait and see ... ;-). I would like to help, but this is way above my head.
Sorry!
Oliver
 
 John Hunter 
 <jdh...@ac...d 
 .uchicago.edu> To 
 Sent by: oli...@ma... 
 matplotlib-users- cc 
 ad...@li...urc mat...@li...urceforge. 
 eforge.net net 
 Subject 
 Re: [Matplotlib-users] problems 
 11.04.2005 19:05 with py2exe 
 
 
 
 
 
 
>>>>> "oliver" == oliver tomic <oli...@ma...> writes:
 oliver> data = glob.glob(r'C:\Python24\Lib\site-packages\matplotlib\*')
The python modules should not be included in the "data" listing. Eg,
you write
 data = glob.glob(r'C:\Python24\Lib\site-packages\matplotlib\*')
but this is wrong because the files in that directory are python
modules.
The data are the fonts, icons, etc, found in
 data = glob.glob(r'C:\Python24\share\matplotlib\*')
See the examples simple_plot_wxagg which I just updated at
 http://matplotlib.sourceforge.net/py2exe_examples.zip
Hope this helps,
JDH
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Matplotlib-users mailing list
Mat...@li...
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users
From: Michael T. <mic...@gm...> - 2005年04月12日 10:25:13
Hi,
On Apr 11, 2005 6:02 PM, John Hunter <jdh...@ac...> wrote:
> >>>>> "andrea" == andrea gavana <and...@ti...> writes:
> 
> andrea> I still get the TimeZone error...
> 
> I spent a little time looking at this this morning. I found that I
> needed to explicitly put the utc timezone in my script that I was
> freezing, it was not enough to include it in my includes list. Oddly,
> this was not consistent. In the simple_plot_wxagg example, I had the
> timezone info in my includes list only and it worked w/o incident. In
> the simple_plot_gtk example, I needed to manually add
> 
> import pytz.zoneinfo.UTC
> 
> to my simple_plot.py script. Strange...
> 
For me I've found that I've needed to include every level of a given
module individually to get it working, e.g. 'pytz', 'pytz.timezone'
and 'pytz.timezone.UTC'. After that py2exe works for me.
This (to me) is an example of how stuff which dynamically imports
modules at runtime trips up stuff like py2exe (I believe the py.test
folks are losing a lot of hair over dynamic imports in their testing
magic too). What I think is happening here (and in encodings) is that
normal usage involves just importing the toplevel module in your app's
code, and at runtime you invoke a call which then goes and imports the
module supplying the code you need. So when py2exe analyses the code,
it doesn't see your runtime import and misses the relevant module.
Adding an explicit import in your app should be pretty much the same
as using a py2exe include, except that it introduces some overhead at
runtime. To handle every timezone your would have to import every
timezone in your app, whereas with py2exe's includes you just specify
what to stick in the zip and the app can import just the timezone it
needs at runtime. Theoretically anyway :)
To add fun to the mix, any package which dynamically imports stuff at
runtime usually has to be careful to either be aware of how it lives
in a zip when frozen, or not to do anything dependant on it's file
path.
> Also, what kinds of files should be in the includes list? For example,
> in Michael's list, he includes
> 
> "matplotlib._na_image",
> "matplotlib._na_transforms",
> "matplotlib._nc_image",
> "matplotlib._nc_transforms",
> 
> but not
> 
> "matplotlib._image"
> "matplotlib._transforms"
> 
> The latter two are python files, the former extension code. Do you
> typically need to manually point py2exe to the extension files?
> 
I've found py2exe has given me difficulty when looking for extensions,
so my list of includes represents partially extensions I've found to
be missing in frozen apps when trying to run them and partially every
other extension I've come across for good measure (since I was doing a
build, crash, add missing extension loop, I decided to add them all).
Depending on how apps and modules handle imports, py2exe seems to be
able to pick up pure python stuff more easily than python extensions.
All this could be just a mix of my particular setup and the
applications I deal with, no two people's py2exe problems ever seem to
be the same :)
All the problems centre around py2exe's module finding logic, every
problem I've encountered has been due to py2exe missing out on one or
two modules (in particular ones which do very dynamic imports at run
time as oppose to import time), so there is a lovely cargo cult feel
to my includes list, I decided the five minutes of adding all the
includes I might need from a given package was worth it, rather than
the repeated half hour of tracking down people's problems when running
the apps.
> Anyway, the wxagg and gtk examples in the updated
> http://matplotlib.sourceforge.net/py2exe_examples.zip build and run on
> my machine. They are a bit of a hack in that I don't really
> understand why/how/when the includes work. If someone can rationalize
> these scripts, improve them, extend them, whatever, send the updates
> my way.
> 
I'll have a go with them and see how they fair under my esoteric
setup. I'm going to bet that I'll have problems no one else does ;)
Michael
From: Werner F. B. <wer...@fr...> - 2005年04月12日 10:23:14
Hi John,
Werner F. Bruhin wrote:
> Hi John,
> 
> John Hunter wrote:
> 
>>>>>>> "Werner" == Werner F Bruhin 
>>>>>>> <wer...@fr...> writes:
>>
>>
>>
>>
>> Werner> By doing this I found a few more oversights (wx to wx.) in
>> Werner> backend, updated version is attached.
>>
>> OK, I've got it working with wxpython 2.5.5.1
>>
>> The only glitch I've noticed so far is that the figsize parameter does
>> not appear to be respected. The windows that are created a
>> considerably smaller than they should be.
>>
>> Any ideas?
> 
> Just did a little test, copied back the originals for backend_wx and 
> backend_wx_agg and run embedding_in_wx4 and the figure size in both 
> cases is about 390x318.
> 
> Which example file are you using were you see a difference?
> 
> BTW, also noticed with the embedding_in_wx4 the CPU usage stays at 100% 
> and I can't close it (at least not always) - again with original or 
> modified code.
To correct the CPU usage change the OnPaint event to include an 
event.Skip() as this:
 def OnPaint(self, event):
 self.canvas.draw()
 event.Skip()
That also makes the toolbar show up correctly.
See you
Werner
> 
>>
>> JDH
>>
> See you
> Werner
> 
>>
>> -------------------------------------------------------
>> SF email is sponsored by - The IT Product Guide
>> Read honest & candid reviews on hundreds of IT Products from real users.
>> Discover which products truly live up to the hype. Start reading now.
>> http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
> 
> 
> 
> 
> 
> -------------------------------------------------------
> SF email is sponsored by - The IT Product Guide
> Read honest & candid reviews on hundreds of IT Products from real users.
> Discover which products truly live up to the hype. Start reading now.
> http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
From: Werner F. B. <wer...@fr...> - 2005年04月12日 10:03:33
Hi John,
John Hunter wrote:
>>>>>>"Werner" == Werner F Bruhin <wer...@fr...> writes:
> 
> 
> 
> Werner> By doing this I found a few more oversights (wx to wx.) in
> Werner> backend, updated version is attached.
> 
> OK, I've got it working with wxpython 2.5.5.1
> 
> The only glitch I've noticed so far is that the figsize parameter does
> not appear to be respected. The windows that are created a
> considerably smaller than they should be.
> 
> Any ideas?
Just did a little test, copied back the originals for backend_wx and 
backend_wx_agg and run embedding_in_wx4 and the figure size in both 
cases is about 390x318.
Which example file are you using were you see a difference?
BTW, also noticed with the embedding_in_wx4 the CPU usage stays at 100% 
and I can't close it (at least not always) - again with original or 
modified code.
> 
> JDH
> 
See you
Werner
> 
> -------------------------------------------------------
> SF email is sponsored by - The IT Product Guide
> Read honest & candid reviews on hundreds of IT Products from real users.
> Discover which products truly live up to the hype. Start reading now.
> http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
From: Werner F. B. <wer...@fr...> - 2005年04月12日 09:29:19
Hi John,
John Hunter wrote:
>>>>>>"Werner" == Werner F Bruhin <wer...@fr...> writes:
> 
> 
> 
> Werner> By doing this I found a few more oversights (wx to wx.) in
> Werner> backend, updated version is attached.
> 
> OK, I've got it working with wxpython 2.5.5.1
> 
> The only glitch I've noticed so far is that the figsize parameter does
> not appear to be respected. The windows that are created a
> considerably smaller than they should be.
> 
> Any ideas?
Only float to int change I did was in the Printer_Print method to remove 
a deprecation warning.
I'll have another look this afternoon.
> 
> JDH
> 
See you
Werner
> 
> -------------------------------------------------------
> SF email is sponsored by - The IT Product Guide
> Read honest & candid reviews on hundreds of IT Products from real users.
> Discover which products truly live up to the hype. Start reading now.
> http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
From: Sajec, M. T. <ms...@tq...> - 2005年04月11日 22:10:13
Is there a simple way to grab x,y coordinates from active plot in a
manner similar to using matlab's ginput() function? =20
Thanks in advance,
-M.
My setup:
WxAgg backend
Matplotlib-0.74
-----Original Message-----
From: mat...@li...
[mailto:mat...@li...] On Behalf Of
mat...@li...
Sent: Thursday, April 07, 2005 8:19 PM
To: mat...@li...
Subject: Matplotlib-users digest, Vol 1 #550 - 11 msgs
Send Matplotlib-users mailing list submissions to
	mat...@li...
To subscribe or unsubscribe via the World Wide Web, visit
	https://lists.sourceforge.net/lists/listinfo/matplotlib-users
or, via email, send a message with subject or body 'help' to
	mat...@li...
You can reach the person managing the list at
	mat...@li...
When replying, please edit your Subject line so it is more specific than
"Re: Contents of Matplotlib-users digest..."
Today's Topics:
 1. Re: Using RendererAgg with windows (jim)
 2. Re: Using RendererAgg with windows (John Hunter)
 3. py2exe Problems... (and...@ti...)
 4. problems with py2exe (oli...@ma...)
 5. imshow axis directions (Stephen Walton)
 6. Re: imshow axis directions (Perry Greenfield)
 7. Re: imshow axis directions (John Hunter)
 8. feature request (Rich Drewes)
 9. Re: imshow axis directions (Stephen Walton)
 10. Re: imshow axis directions (Robert Kern)
 11. Re: imshow axis directions (Stephen Walton)
--__--__--
Message: 1
From: jim <jl...@yv...>
To: John Hunter <jdh...@ac...>
Subject: Re: [Matplotlib-users] Using RendererAgg with windows
Date: Thu, 7 Apr 2005 03:29:12 +0000
Cc: mat...@li...
John:
What I need to do is create drawings of windows (as in plug holes in
houses and let in light) with grid and other options on the fly.
So what I need are the graphic primitives -- canvas, lines, fills ...
The output needs to be a graphic file. =20
I will go back and study the docs, but a suggestion of what area to use
would be most welcome. Or, of course, a different module than
matplotlib if that would be more appropriate.
Thanks,
Jim
On Wednesday 06 April 2005 08:13 pm, you wrote:
> >>>>> "jim" =3D=3D jim <jl...@yv...> writes:
>=20
> jim> Running this script gives the results below #! /usr/bin/env
> jim> python
>=20
> jim> from matplotlib.backends.backend_agg import RendererAgg from
> jim> matplotlib.transforms import Value
>=20
> I know there are examples in the pdf user's guide discussing how to=20
> use the backend renderer directly, and these are meant mostly to be=20
> helpful to matplotlib developers. Unfortunately, the guide has lagged
> behind the current development state. The backend renderer API is in=20
> a transition state right now as we try to introduce some new methods=20
> to solve some old problems. In particular, the draw_lines method that
> you are experiencing problems with has recently had a change in its=20
> call signature.
>=20
> These changes have been discussed at some length recently on the=20
> matplotlib-devel list. If you are interested, you might want to=20
> browse the matplotlib-devel archives and/or join the mailing list; see
> for example
>=20
http://sourceforge.net/mailarchive/forum.php?thread_id=3D6938045&forum_id=
=3D
36187 .
>=20
> Thanks for reporting this discrepancy -- in the near term the backend=20
> API shouldn't be used on the user side. If there is something you=20
> want to do but can't in the current API let me know.
>=20
> As for the platform specific differences you report, my first guess is
> that the matplotlib versions may not be the same. I wouldn't expect=20
> platform specific differences in the backend API for the same version.
>=20
> JDH
>=20
>=20
>=20
>=20
--__--__--
Message: 2
To: jim <jl...@yv...>
Cc: mat...@li...
Subject: Re: [Matplotlib-users] Using RendererAgg with windows
From: John Hunter <jdh...@ac...>
Date: 2005年4月06日 22:47:56 -0500
>>>>> "jim" =3D=3D jim <jl...@yv...> writes:
 jim> John: What I need to do is create drawings of windows (as in
 jim> plug holes in houses and let in light) with grid and other
 jim> options on the fly.
 jim> So what I need are the graphic primitives -- canvas, lines,
 jim> fills ... The output needs to be a graphic file.
You probably want to be using matplotlib primitives. Assuming you have
a matplotlib.axes.Axes (or Subplot) instance stored as "ax", The
primitives are
 matplotlib.lines.Line2D - add with ax.add_line=20
 matplotlib.patches.Rectangle - add with ax.add_patch
 matplotlib.patches.Polygon - add with ax.add_patch
 matplotlib.patches.RegularPolygon - add with ax.add_patch
 matplotlib.patches.Circle - add with ax.add_patch
 matplotlib.patches.Text - add with ax.add_artist
Ie, there are not too many mpl primitives, and using these will insulate
you from changes in the mpl backend (renderer) api. The backend API is
meant only for mpl developers. The classes referred to above are all
part of the matplotlib Artist hierarchy.
 jim> I will go back and study the docs, but a suggestion of what
 jim> area to use would be most welcome. Or, of course, a
 jim> different module than matplotlib if that would be more
 jim> appropriate.
To reiterate, there is one base class matplotlib.artist.Artist that all
the objects that render into the figure derive from. From this, there
are just a few derived classes to be aware of: Line2D, Patch, Text, and
Collection. From these there are a few more derived classes (eg Patch
and Collection have some specialized derived classes, Line2D and Text do
not as of yet). Other Artists (including Figure, Axes, Legend, Table
and so on) are simply composites of these primitive types. See the
following class docs for more info:
 http://matplotlib.sourceforge.net/matplotlib.artist.html
 http://matplotlib.sourceforge.net/matplotlib.lines.html
 http://matplotlib.sourceforge.net/matplotlib.patches.html
 http://matplotlib.sourceforge.net/matplotlib.text.html
 http://matplotlib.sourceforge.net/matplotlib.collections.html
In short, you should concentrate on building the primitive types you
need rather than calling the renderer methods directly. The primitives
will call the right renderer methods as necessary (as they do in
matplotlib.lines, for example).
Hope this helps,
JDH
--__--__--
Message: 3
Date: Thu, 7 Apr 2005 11:03:38 +0200
From: and...@ti...
To: mat...@li...
Subject: [Matplotlib-users] py2exe Problems...
Hello NG,
 this morning I have done the really BIG mistake of uninstalling the
following things:
- Numeric 23.5
- ctypes 0.9.2
- numarray 1.1.1
- Matplotlib 0.72
And I have installed the following:
- Numeric 23.8
- ctypes 0.9.6
- numarray 1.2.3
- Matplotlib 0.74
Using py2exe 0.5.4, now I get some errors on not-found modules, that I
pu=3D t at the end of the mail. I have never encountered these problems
with olde=3D r versions of the aforementioned tools. Please note that, a
part the VTK th=3D ings, almost all the missing modules are from
numerix/backends. If I try to sta=3D rt the application, I get a Visual
C++ runtime error (and not the usual MYEX=3D E.exe.log message from
py2exe, so I do not know how to track the error).=20
I am on a Windows 2000 machine.
Deinstalling the new tools and re-installing the old ones didn't help
any=3D more...
Does anyone have a suggestion?
['backends.draw_if_interactive', 'backends.new_figure_manager',
'backends=3D .show', 'cephes', 'dl', 'libvtkCommonPython',
'libvtkFilteringPython', 'libvtkGr=3D aphicsP ython',
'libvtkHybridPython', 'libvtkIOPython', 'libvtkImagingPython', 'l=3D
ibvtkPa rallelPython', 'libvtkPatentedPython', 'libvtkRenderingPython',
'numerix.=3D ArrayTy pe', 'numerix.Complex', 'numerix.Complex32',
'numerix.Complex64', 'numeri=3D x.Float ', 'numerix.Float32',
'numerix.Float64', 'numerix.Int', 'numerix.Int16', 'numeri x.Int32',
'numerix.Int8', 'numerix.Matrix', 'numerix.UInt16', 'numerix.UI=3D =
nt32',
'numerix.UInt8', 'numerix.absolute', 'numerix.add', 'numerix.allclose',
'numerix .alltrue', 'numerix.arange', 'numerix.arccos',
'numerix.arccosh', 'numeri=3D x.arcsi n', 'numerix.arcsinh',
'numerix.arctan', 'numerix.arctan2', 'numerix.arct=3D anh', '
numerix.argmax', 'numerix.argmin', 'numerix.argsort', 'numerix.around',
'numerix .array', 'numerix.arrayrange', 'numerix.asarray',
'numerix.asum', 'numeri=3D x.bitwi se_and', 'numerix.bitwise_or',
'numerix.bitwise_xor', 'numerix.ceil', 'nu=3D merix.c hoose',
'numerix.clip', 'numerix.compress', 'numerix.concatenate', 'numer=3D
ix.conj ugate', 'numerix.convolve', 'numerix.cos', 'numerix.cosh',
'numerix.cross=3D _correl ate', 'numerix.cumproduct', 'numerix.cumsum',
'numerix.diagonal', 'numeri=3D x.divid e', 'numerix.dot', =
'numerix.equal',
'numerix.exp', 'numerix.fabs', 'numer=3D ix.fft.
fft', 'numerix.floor', 'numerix.fmod', 'numerix.fromfunction',
'numerix.f=3D romstri ng', 'numerix.greater', 'numerix.greater_equal',
'numerix.hypot', 'numeri=3D x.ident ity', 'numerix.indices',
'numerix.innerproduct', 'numerix.less', 'numerix=3D .less_e qual',
'numerix.log', 'numerix.log10', 'numerix.logical_and', 'numerix.lo=3D
gical_n ot', 'numerix.logical_or', 'numerix.logical_xor',
'numerix.matrixmultiply=3D ', 'num erix.maximum', 'numerix.minimum',
'numerix.mlab.amax', 'numerix.mlab.amin=3D ', 'num erix.mlab.cov',
'numerix.mlab.diff', 'numerix.mlab.flipud', 'numerix.mlab=3D .hannin g',
'numerix.mlab.rand', 'numerix.mlab.std', 'numerix.mlab.svd', 'numerix=3D
.multip ly', 'numerix.negative', 'numerix.nonzero', 'numerix.not_equal',
'numerix=3D .nx', '
numerix.ones', 'numerix.outerproduct', 'numerix.pi', 'numerix.power',
'nu=3D merix.p roduct', 'numerix.put', 'numerix.putmask', =
'numerix.rank',
'numerix.ravel=3D ', 'num erix.repeat', 'numerix.reshape',
'numerix.resize', 'numerix.searchsorted'=3D , 'nume rix.shape',
'numerix.sin', 'numerix.sinh', 'numerix.size', 'numerix.somet=3D rue', '
numerix.sort', 'numerix.sqrt', 'numerix.subtract', 'numerix.swapaxes',
'n=3D umerix.
take', 'numerix.tan', 'numerix.tanh', 'numerix.trace',
'numerix.transpose=3D ', 'num erix.where', 'numerix.which',
'numerix.zeros', 'vtkParallelPython', 'matp=3D lotlib.
numerix.absolute', 'matplotlib.numerix.equal', 'numarray.Complex',
'numar=3D ray.Com plex32', 'numarray.Complex64', 'numarray.Float',
'numarray.Float32', 'num=3D array.F loat64', 'numarray.Int',
'numarray.Int16', 'numarray.Int32', 'numarray.In=3D t8', 'n
umarray.NumArray', 'numarray.UInt16', 'numarray.UInt32',
'numarray.UInt8'=3D , 'numa rray._dotblas', 'numarray.asarray',
'numarray.dot', 'numarray.fromlist', 'numarr ay.shape',
'numarray.typecode', 'numarray.zeros', 'wx.BitmapFromImage', 'wx.Empt
yIcon']
--__--__--
Message: 4
To: mat...@li...
From: oli...@ma...
Date: Thu, 7 Apr 2005 11:27:43 +0200
Subject: [Matplotlib-users] problems with py2exe
Hi,
I have some problems compiling an .exe-file for my application. I use
wxPython together with matplotlib and tried to make an .exe-file with
both packages for the first time.
Windows XP
Python 2.4
wxPython 2.5.3.1
matplotlib 0.74
I checked the FAQ at the matplotlib homepage and the py2exe-examples and
did the following:
from distutils.core import setup
import glob
import py2exe
data =3D glob.glob(r'C:\Python24\Lib\site-packages\matplotlib\*')
data.append(r'C:\Python24\Lib\site-packages\matplotlib\.matplotlibrc')
setup(
 console =3D ["PanelCheck.py"],
 data_files =3D [("matplotlibdata", data)],
 )
After py2exe is finished I find both folders 'dist' and 'build' as
ususal, however I can't finde an .exe-file of my application
PanelCheck.py in the dist-folder.
I assume that 'window' is what I want to use in the code above, but when
I do that I get the following error:
--(just a small part of the console output)--
error: can't copy 'C:\Python24\Lib\site-packages\matplotlib\backends':
doesn't exist or not a regular file
What am I doing wrong? Help is really appreciated!
Oliver
--__--__--
Message: 5
Date: 2005年4月07日 11:08:01 -0700
From: Stephen Walton <ste...@cs...>
To: matplotlib-users <mat...@li...>
Subject: [Matplotlib-users] imshow axis directions
Hi,
I was just comparing images displayed with imshow() with what I get from
IRAF's display command and ds9. The latter puts the first axis
increasing horizontally and the second axis increasing vertically, as if
the image array were addressed as img[ix,iy], where ix and iy are
integer x and y coordinates. The axes imshow() produces are labeled as
if this is true for it as well, but in fact the image is upside down
with respect to what I see with IRAF. Even odder, to see the same
display I see in IRAF I have to do imshow(img[::-1,:]), as if I'm
reversing the direction of the first axis.
I've tried to look at the source, really, but I feel like I'm *years*
away from being enough of a Python hacker to understand matplotlib.
Steve
--__--__--
Message: 6
Cc: matplotlib-users <mat...@li...>,
 Perry Greenfield <pe...@st...>
From: Perry Greenfield <pe...@st...>
Subject: Re: [Matplotlib-users] imshow axis directions
Date: Thu, 7 Apr 2005 14:12:16 -0400
To: Stephen Walton <ste...@cs...>
check out the .matplotlibrc image.origin configuration parameter. The
default is to have pixel 0,0 on the upper left which is opposite of what
us weird astronomers think is the natural locationl
Perry
On Apr 7, 2005, at 2:08 PM, Stephen Walton wrote:
> Hi,
>
> I was just comparing images displayed with imshow() with what I get=20
> from IRAF's display command and ds9. The latter puts the first axis=20
> increasing horizontally and the second axis increasing vertically, as=20
> if the image array were addressed as img[ix,iy], where ix and iy are=20
> integer x and y coordinates. The axes imshow() produces are labeled=20
> as if this is true for it as well, but in fact the image is upside=20
> down with respect to what I see with IRAF. Even odder, to see the=20
> same display I see in IRAF I have to do imshow(img[::-1,:]), as if I'm
> reversing the direction of the first axis.
>
> I've tried to look at the source, really, but I feel like I'm *years*=20
> away from being enough of a Python hacker to understand matplotlib.
>
> Steve
>
>
>
> -------------------------------------------------------
> SF email is sponsored by - The IT Product Guide Read honest & candid=20
> reviews on hundreds of IT Products from real users.
> Discover which products truly live up to the hype. Start reading now.
> http://ads.osdn.com/?ad_id=3D6595&alloc_id=3D14396&op=3Dclick
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
--__--__--
Message: 7
To: Stephen Walton <ste...@cs...>
Cc: matplotlib-users <mat...@li...>
Subject: Re: [Matplotlib-users] imshow axis directions
From: John Hunter <jdh...@ac...>
Date: 2005年4月07日 13:15:35 -0500
>>>>> "Stephen" =3D=3D Stephen Walton <ste...@cs...> writes:
 Stephen> Hi, I was just comparing images displayed with imshow()
 Stephen> with what I get from IRAF's display command and ds9. The
 Stephen> latter puts the first axis increasing horizontally and
 Stephen> the second axis increasing vertically, as if the image
 Stephen> array were addressed as img[ix,iy], where ix and iy are
 Stephen> integer x and y coordinates. The axes imshow() produces
 Stephen> are labeled as if this is true for it as well, but in
 Stephen> fact the image is upside down with respect to what I see
 Stephen> with IRAF. Even odder, to see the same display I see in
 Stephen> IRAF I have to do imshow(img[::-1,:]), as if I'm
 Stephen> reversing the direction of the first axis.
Does changing the rc param
 image.origin : upper # lower | upper
to lower help?
 Stephen> I've tried to look at the source, really, but I feel like
 Stephen> I'm *years* away from being enough of a Python hacker to
 Stephen> understand matplotlib.
Hmm, the code's not that bad is it :-)
JDH
--__--__--
Message: 8
Date: Thu, 7 Apr 2005 11:51:37 -0700 (PDT)
From: Rich Drewes <dr...@in...>
To: matplotlib-users <mat...@li...>
Subject: [Matplotlib-users] feature request
Some ability to specify empty space between subplots would be very
convenient. I'm not sure if this could best be done at figure creation
or at subplot creation with an additional argument that says how much
space to leave above or below.
The motivation is that creating subplots with separate titles is a very
common desire, and doing so now results in title text that invariably
overlaps the plot above (or if the font is reduced enough, it may fit
but looks squished in there).
Using manual axes creation is another approach that has been suggested,
but this is a pain and seems to obviate the convenience of subplot().
If there is a better approach than creating custom axes, I'd love to
hear about it.
Thanks to all the pylab developers!
Rich
--__--__--
Message: 9
Date: 2005年4月07日 12:00:27 -0700
From: Stephen Walton <ste...@cs...>
To: John Hunter <jdh...@ni...>
CC: matplotlib-users <mat...@li...>
Subject: Re: [Matplotlib-users] imshow axis directions
John Hunter wrote:
>>>>>>"Stephen" =3D=3D Stephen Walton <ste...@cs...> writes:
>>>>>> =20
>>>>>>
>Does changing the rc param
>
> image.origin : upper # lower | upper
>
>to lower help?
> =20
>
Yes, it makes the image the right way around. I was simply confused
because I expected the pixel at (x,y) in the imshow display to be the
value of img[x,y]. It appears not to be. I hasten to add MATLAB's
worse, as the pixel at (x,y) is actually the value of img[y,x]; MATLAB
displays with the first array coordinate increasing downward and the
second from left to right.
> Stephen> I've tried to look at the source, really, but I feel like
> Stephen> I'm *years* away from being enough of a Python hacker to
> Stephen> understand matplotlib.
>
>Hmm, the code's not that bad is it :-)
> =20
>
I'm sure the code is fine, John, and it's just me. Specifically, if I
want to see how matplotlib is doing something, I can't just trace
function calls like I'm used to doing with Fortran and C, because there
are methods too and I have to find the class which defines those methods
to see what's happening. Is there anything like ctags for Python?
Steve
--__--__--
Message: 10
Date: 2005年4月07日 14:35:11 -0700
From: Robert Kern <rk...@uc...>
Organization: The Church of Last Thrusday
To: mat...@li...
Subject: Re: [Matplotlib-users] imshow axis directions
Stephen Walton wrote:
> I'm sure the code is fine, John, and it's just me. Specifically, if I
> want to see how matplotlib is doing something, I can't just trace=20
> function calls like I'm used to doing with Fortran and C, because=20
> there are methods too and I have to find the class which defines those
> methods to see what's happening. Is there anything like ctags for
Python?
Exuberant ctags
http://ctags.sourceforge.net/
--
Robert Kern
rk...@uc...
"In the fields of hell where the grass grows high
 Are the graves of dreams allowed to die."
 -- Richard Harter
--__--__--
Message: 11
Date: 2005年4月07日 16:03:17 -0700
From: Stephen Walton <ste...@cs...>
To: Robert Kern <rk...@uc...>
CC: mat...@li...
Subject: Re: [Matplotlib-users] imshow axis directions
Robert Kern wrote:
> Exuberant ctags
>
> http://ctags.sourceforge.net/
>
Which, as it turns out, is the version of ctags on Fedora Core 3. I did
a 'ctags -R' in the matplotlib root directory and am now happily
browsing the source using nedit.
Thanks, Robert!
Steve
--__--__--
_______________________________________________
Matplotlib-users mailing list
Mat...@li...
https://lists.sourceforge.net/lists/listinfo/matplotlib-users
End of Matplotlib-users Digest
From: John H. <jdh...@ac...> - 2005年04月11日 19:38:33
>>>>> "Werner" == Werner F Bruhin <wer...@fr...> writes:
 Werner> By doing this I found a few more oversights (wx to wx.) in
 Werner> backend, updated version is attached.
OK, I've got it working with wxpython 2.5.5.1
The only glitch I've noticed so far is that the figsize parameter does
not appear to be respected. The windows that are created a
considerably smaller than they should be.
Any ideas?
JDH
From: Travis B. <td...@fa...> - 2005年04月11日 19:12:24
What does everyone think is the best way to go about plotting in
Matplotlib?
It seems that pylab is clearly the easiest out of the box, but with
experience perhaps the flexibility of creating a figure and then axes
and so on is the most powerful?
Just curious what everyone thinks.
Best,
Travis
On 2005年4月11日 15:18:30 +0200, "Werner F. Bruhin"
<wer...@fr...> said:
> Hi Philipple,
>=20
> This might help your for the title.
>=20
> self.figure.text(0.5, 0.95, title,
> horizontalalignment=3D'center')
> self.figure.text(0.5, 0.92, 'sub title',
> horizontalalignment=3D'center')
>=20
> See you
> Werner
>=20
> Philippe COLLET wrote:
>=20
> > Hi everybody,
> > As i go through matplotlib tutorial and trying to test it, i didn't fin=
d=20
> > a way to customize the position of the title, the xlabel and the ylabel.
> > Is there a way to do it?
> > Are those elements of a figure placed in a standard way?
> >=20
> > Thanks for answers.
> > Philippe
> >=20
> > _________________________________________________________________
> > MSN Messenger : personnalisez votre messagerie instantan=E9e !=20
> > http://g.msn.fr/FR1001/866
> >=20
> >=20
> >=20
> > -------------------------------------------------------
> > SF email is sponsored by - The IT Product Guide
> > Read honest & candid reviews on hundreds of IT Products from real users.
> > Discover which products truly live up to the hype. Start reading now.
> > http://ads.osdn.com/?ad_id=3D6595&alloc_id=3D14396&op=3Dclick
>=20
>=20
>=20
> -------------------------------------------------------
> SF email is sponsored by - The IT Product Guide
> Read honest & candid reviews on hundreds of IT Products from real users.
> Discover which products truly live up to the hype. Start reading now.
> http://ads.osdn.com/?ad_id=3D6595&alloc_id=3D14396&op=3Dclick
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
--=20
 Travis Brady
 td...@fa...
John Hunter wrote:
> wxapp = None # module level
> 
> def new_figure_manager(num, *args, **kwargs):
> global wxapp
> if wxapp is None:
> wxapp = wx.PySimpleApp()
> wxapp.SetExitOnFrameDelete(True)
> ...snipsnip...
> 
> 
> 
> def show():
> ...snipsnip...
> if show._needmain and not matplotlib.is_interactive():
> if wxapp is not None: wxapp.MainLoop()
> show._needmain = False 
> 
> 
> And this seems to work for pylab and wx apps. Since apps will never
> call new_figure_manager or show, there should be no problem
> 
> 
> If there is a better / more elegant / more wxlike way to do this, let
> me know.
You should check wx.GetApp() to ensure that the app hasn't already been 
created in some other module.
-- 
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!
From: Werner F. B. <wer...@fr...> - 2005年04月11日 17:55:51
Attachments: backend_wx.py
Hi John,
I took your zip file and changed the simple_plot_agg sample to just this 
and it looks like it works:
data = glob.glob(r'C:\Python24\share\matplotlib\*')
#data.append(r'C:\Enthon23\share\matplotlib\.matplotlibrc')
setup(console=["simple_plot.py"],
 data_files=[("matplotlibdata",data)],
 options = {"py2exe": {"compressed": 1,
 # optimize may break pylab docstring handling
 #"optimize": 2,
 #"includes": includes,
 #"excludes": excludes,
 "packages": ["encodings", "pytz"],
 }},
 )
Note that I use "packages" and NOT include, all the matplotlib and 
numeric stuff seems to get detected correctly by py2exe.
The excludes don't seem to make a difference, I think py2exe removes 
them now by itself.
Only error/warnings I get is that I did not include an .matplotlibrc 
file. Could you send me yours?
By doing this I found a few more oversights (wx to wx.) in backend, 
updated version is attached.
See you
Werner
John Hunter wrote:
>>>>>>"andrea" == andrea gavana <and...@ti...> writes:
> 
> 
> andrea> I still get the TimeZone error...
> 
> I spent a little time looking at this this morning. I found that I
> needed to explicitly put the utc timezone in my script that I was
> freezing, it was not enough to include it in my includes list. Oddly,
> this was not consistent. In the simple_plot_wxagg example, I had the
> timezone info in my includes list only and it worked w/o incident. In
> the simple_plot_gtk example, I needed to manually add
> 
> import pytz.zoneinfo.UTC 
> 
> to my simple_plot.py script. Strange...
> 
> Also, what kinds of files should be in the includes list? For example,
> in Michael's list, he includes
> 
> "matplotlib._na_image",
> "matplotlib._na_transforms",
> "matplotlib._nc_image",
> "matplotlib._nc_transforms",
> 
> 
> but not 
> 
> "matplotlib._image"
> "matplotlib._transforms"
> 
> The latter two are python files, the former extension code. Do you
> typically need to manually point py2exe to the extension files?
> 
> Anyway, the wxagg and gtk examples in the updated
> http://matplotlib.sourceforge.net/py2exe_examples.zip build and run on
> my machine. They are a bit of a hack in that I don't really
> understand why/how/when the includes work. If someone can rationalize
> these scripts, improve them, extend them, whatever, send the updates
> my way.
> 
> JDH
> 
> 
> -------------------------------------------------------
> SF email is sponsored by - The IT Product Guide
> Read honest & candid reviews on hundreds of IT Products from real users.
> Discover which products truly live up to the hype. Start reading now.
> http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
From: John H. <jdh...@ac...> - 2005年04月11日 17:19:19
>>>>> "Matt" == Matt Newville <new...@ca...> writes:
 Matt> Hi John, These changes to backend_wx(agg).py seem ok to me.
 Matt> Trying to be conservative, I'm not entirely sure whether
 Matt> having the SetExitonFrameDelete() call is necessary (or
 Matt> perhaps more settings for the wxapp should be set....).
 Matt> What's pylab supposed to do in interactive mode if the user
 Matt> closes the plot window after show() but then wants to create
 Matt> and show() another figure? Is pylab supposed to
 Matt> automatically create another window and plot to that new
 Matt> window? This doesn't work for WX.
In interactive mode the user shouldn't call show --
http://matplotlib.sourceforge.net/faq.html#SHOW because the figures
will be automatically realized in interactive mode.
Using ipython pylab mode with WX or WXAgg as my default backend,
everything works as expected (eg I can close the window and the next
plot command creates a new one). If you ware testing interactively in
a standard python shell w/o proper threading support for wx, I'm not
sure what will happen but it's not officially a supported mode of
working. Some people do use show in this mode to try and make things
work, but I don't have much experience with it.
I also just tested backend : WX with interactive : True in pycrust and
it also worked (new windows created after close, no use of show)
JDH
2 messages has been excluded from this view by a project administrator.

Showing results of 284

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