SourceForge logo
SourceForge logo
Menu

matplotlib-users — Discussion related to using matplotlib

You can subscribe to this list here.

2003 Jan
Feb
Mar
Apr
May
(3)
Jun
Jul
Aug
(12)
Sep
(12)
Oct
(56)
Nov
(65)
Dec
(37)
2004 Jan
(59)
Feb
(78)
Mar
(153)
Apr
(205)
May
(184)
Jun
(123)
Jul
(171)
Aug
(156)
Sep
(190)
Oct
(120)
Nov
(154)
Dec
(223)
2005 Jan
(184)
Feb
(267)
Mar
(214)
Apr
(286)
May
(320)
Jun
(299)
Jul
(348)
Aug
(283)
Sep
(355)
Oct
(293)
Nov
(232)
Dec
(203)
2006 Jan
(352)
Feb
(358)
Mar
(403)
Apr
(313)
May
(165)
Jun
(281)
Jul
(316)
Aug
(228)
Sep
(279)
Oct
(243)
Nov
(315)
Dec
(345)
2007 Jan
(260)
Feb
(323)
Mar
(340)
Apr
(319)
May
(290)
Jun
(296)
Jul
(221)
Aug
(292)
Sep
(242)
Oct
(248)
Nov
(242)
Dec
(332)
2008 Jan
(312)
Feb
(359)
Mar
(454)
Apr
(287)
May
(340)
Jun
(450)
Jul
(403)
Aug
(324)
Sep
(349)
Oct
(385)
Nov
(363)
Dec
(437)
2009 Jan
(500)
Feb
(301)
Mar
(409)
Apr
(486)
May
(545)
Jun
(391)
Jul
(518)
Aug
(497)
Sep
(492)
Oct
(429)
Nov
(357)
Dec
(310)
2010 Jan
(371)
Feb
(657)
Mar
(519)
Apr
(432)
May
(312)
Jun
(416)
Jul
(477)
Aug
(386)
Sep
(419)
Oct
(435)
Nov
(320)
Dec
(202)
2011 Jan
(321)
Feb
(413)
Mar
(299)
Apr
(215)
May
(284)
Jun
(203)
Jul
(207)
Aug
(314)
Sep
(321)
Oct
(259)
Nov
(347)
Dec
(209)
2012 Jan
(322)
Feb
(414)
Mar
(377)
Apr
(179)
May
(173)
Jun
(234)
Jul
(295)
Aug
(239)
Sep
(276)
Oct
(355)
Nov
(144)
Dec
(108)
2013 Jan
(170)
Feb
(89)
Mar
(204)
Apr
(133)
May
(142)
Jun
(89)
Jul
(160)
Aug
(180)
Sep
(69)
Oct
(136)
Nov
(83)
Dec
(32)
2014 Jan
(71)
Feb
(90)
Mar
(161)
Apr
(117)
May
(78)
Jun
(94)
Jul
(60)
Aug
(83)
Sep
(102)
Oct
(132)
Nov
(154)
Dec
(96)
2015 Jan
(45)
Feb
(138)
Mar
(176)
Apr
(132)
May
(119)
Jun
(124)
Jul
(77)
Aug
(31)
Sep
(34)
Oct
(22)
Nov
(23)
Dec
(9)
2016 Jan
(26)
Feb
(17)
Mar
(10)
Apr
(8)
May
(4)
Jun
(8)
Jul
(6)
Aug
(5)
Sep
(9)
Oct
(4)
Nov
Dec
2017 Jan
(5)
Feb
(7)
Mar
(1)
Apr
(5)
May
Jun
(3)
Jul
(6)
Aug
(1)
Sep
Oct
(2)
Nov
(1)
Dec
2018 Jan
Feb
Mar
Apr
(1)
May
Jun
Jul
Aug
Sep
Oct
Nov
Dec
2020 Jan
Feb
Mar
Apr
May
(1)
Jun
Jul
Aug
Sep
Oct
Nov
Dec
2025 Jan
(1)
Feb
Mar
Apr
May
Jun
Jul
Aug
Sep
Oct
Nov
Dec
S M T W T F S






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





Showing 7 results of 7

From: Peter G. <pgr...@ge...> - 2004年05月25日 22:30:53
Hi:
The following script:
#!/usr/bin/env python
from matplotlib.matlab import *
figure(1)
plot([0],[0])
show()
gives this traceback:
Traceback (most recent call last):
 File 
"/usr/lib/python2.2/site-packages/matplotlib/backends/backend_gtkagg.py", 
line 75, in callback
 self.draw()
 File 
"/usr/lib/python2.2/site-packages/matplotlib/backends/backend_gtkagg.py", 
line 42, in draw
 agg.draw()
 File 
"/usr/lib/python2.2/site-packages/matplotlib/backends/backend_agg.py", 
line 299, in draw
 self.figure.draw(self.renderer)
 File "/usr/lib/python2.2/site-packages/matplotlib/figure.py", line 
128, in draw
 for a in self.axes: a.draw(renderer)
 File "/usr/lib/python2.2/site-packages/matplotlib/axes.py", line 603, 
in draw
 self.xaxis.draw(renderer)
 File "/usr/lib/python2.2/site-packages/matplotlib/axis.py", line 463, 
in draw
 tick.draw(renderer)
 File "/usr/lib/python2.2/site-packages/matplotlib/axis.py", line 130, 
in draw
 if self.label1On: self.label1.draw(renderer)
 File "/usr/lib/python2.2/site-packages/matplotlib/text.py", line 202, 
in draw
 ismath=self.is_math_text())
 File 
"/usr/lib/python2.2/site-packages/matplotlib/backends/backend_agg.py", 
line 203, in draw_text
 self._renderer.draw_text(
OverflowError: float too large to convert
If I remember correctly, there was a similar issue when 0.53 came out.
-- 
Peter Groszkowski Gemini Observatory
Tel: +1 808 974-2509 670 N. A'ohoku Place
Fax: +1 808 935-9235 Hilo, Hawai'i 96720, USA
From: Todd M. <jm...@st...> - 2004年05月25日 21:35:43
On Tue, 2004年05月25日 at 17:11, Todd Miller wrote:
> On Tue, 2004年05月25日 at 11:13, John Hunter wrote:
> > >>>>> "Todd" == Todd Miller <jm...@st...> writes:
> > 
> > Todd> I tried porting anim.py to TkAgg this morning and got it
> > Todd> basically working. There are two things that might account
> > Todd> for the trouble you've been having:
> > 
> > Todd> 1. With TkAgg, at least for now, you have to call the
> > Todd> figure manager show() method with each cycle rather than the
> > Todd> canvas draw() method.
> > 
> > Would it be possible to reorganize tkagg so that a call to canvas.draw
> > also triggers a blit so that the interface could be more consistent
> > across backends?
> 
> I've been on leave a lot today but I'll take a look at this either this
> evening or tomorrow morning.
> 
This turned out to be really easy so now canvas.draw triggers a blit and
functions more like the other backends. It's in CVS. I also found an
extraneous draw() so performance should be better, perhaps 2x.
Cheers,
Todd
From: Todd M. <jm...@st...> - 2004年05月25日 21:12:13
On Tue, 2004年05月25日 at 11:13, John Hunter wrote:
> >>>>> "Todd" == Todd Miller <jm...@st...> writes:
> 
> Todd> I tried porting anim.py to TkAgg this morning and got it
> Todd> basically working. There are two things that might account
> Todd> for the trouble you've been having:
> 
> Todd> 1. With TkAgg, at least for now, you have to call the
> Todd> figure manager show() method with each cycle rather than the
> Todd> canvas draw() method.
> 
> Would it be possible to reorganize tkagg so that a call to canvas.draw
> also triggers a blit so that the interface could be more consistent
> across backends?
I've been on leave a lot today but I'll take a look at this either this
evening or tomorrow morning.
Todd
From: Gary P. <pa...@in...> - 2004年05月25日 16:02:25
> Gary: did Todd's example help you enough to speed you on your way?
>
> JDH
>
Well... I might say "yes", but you did put that word "speed" in there :)
If I run his code, it updates 1.5 frame per second. If I change the two
calls to
manager.canvas._tkcanvas.after(100, updatefig)
to
manager.canvas._tkcanvas.after(1, updatefig)
there is no difference in the speed.
FWIW, I'm on an 850MHz WinXP. IIRC, I get the same performance under linux
on the same machine.
You got five frames per second? When you say you improved performance
"without text" do you mean that you didn't label the axes?
Aside: I see that he calls show() in each iteration, yet John says show()
should only be called once per script. Todd seems
to be on top of this, so I'll take his word as good. Todd uses a figure
manager. I can copy that code, but I don't know what I'm doing with it. I
don't know what a figure manager does.
Finally, I'm not sure what he meant by "re-registering the handler with each
cycle". Does this mean call ....after() ?
Oh ... one last thing, and maybe this is somehow relevant ... Todd's
program crashes on exit with message:
>>> invalid command name "18438384callit"
 while executing
"18438384callit"
 ("after" script)
...after which I'm dumped into python (interactive prompt).
-gary
From: John H. <jdh...@ac...> - 2004年05月25日 15:35:49
>>>>> "Todd" == Todd Miller <jm...@st...> writes:
 Todd> I tried porting anim.py to TkAgg this morning and got it
 Todd> basically working. There are two things that might account
 Todd> for the trouble you've been having:
 Todd> 1. With TkAgg, at least for now, you have to call the
 Todd> figure manager show() method with each cycle rather than the
 Todd> canvas draw() method.
Would it be possible to reorganize tkagg so that a call to canvas.draw
also triggers a blit so that the interface could be more consistent
across backends?
 Todd> 2. The Tk timed event system requires re-registering the
 Todd> handler with each cycle.
Or you can do something like this
 def updatefig(*args):
 updatefig.count += 1
 lines[0].set_ydata(X[:,updatefig.count%60])
 manager.show()
 return updatefig.count
 updatefig.count=-1
 while 1:
 cnt = updatefig()
 if cnt==100: break
 
 Todd> Performance was better than I thought it would be but still
 Todd> kinda slow.
I profiled this because it was slower than I expected. Turns out that
there is a huge performance hit in the changes I made to Text to
handle arbitrary rotations (a lot of time spent in Matrix getitem,
multiply, etc...). With text I could get only 5 frames per second;
w/o text I get 13 fps. The good news is that it will be easy to
optimize away most of the text based performance hit using more
efficient matrix operations and caching.
This can likely be improved further by using collections for drawing
markers in the line class.
Gary: did Todd's example help you enough to speed you on your way?
JDH
From: John H. <jdh...@ac...> - 2004年05月25日 14:16:21
>>>>> "Gary" == Gary Ruben <ga...@em...> writes:
 Gary> Hi John, I probably didn't make it clear, but TkAgg has
 Gary> problems too. Here's what I know: Under 0.53.1 TkAgg and
 Gary> GTKAgg both worked fine, both when running the script
 Gary> directly from Windows Explorer in which case file
 Gary> association cause python to fire up in a DOS shell, and when
 Gary> running it from within SciTE or IDLE things are fine
 Gary> too. 0.54 has changed something.
Well, it's changed a lot. The big dollar question is which of these
changes are causing these problems :-)
 Gary> I tried grabbing and
 Gary> running a few examples from CVS as well as my own previously
 Gary> working examples. They behave consistently - GTKAgg no
 Gary> longer works at all
I need clarification here. What does it mean "no longer works at
all". If you open up a DOS command shell and run
 from matplotlib.matlab import *
 plot([1,2,3])
 show()
with 
 c:> python myscript.py -dGTKAgg
what happens? When you run from windows explorer and get a traceback,
you often lose the DOS window that provides the required information.
So it's best to debug from a command shell, though admittedly most of
the windows shells suck.
 Gary> and TkAgg works but only if I run it from DOS with a
 Gary> -dTkAgg option. It may be a GUI conflict but it has only
 Gary> started to conflict with 0.54. removing show() or replacing
 Gary> it with show(mainloop=False) seem to make no difference to
 Gary> the behaviour running TkAgg from SciTE. 
show(mainloop=False) would only be expected to have any effect with
GTK*, but I understand that it's not helping in that case either.
 Gary> I do notice that
 Gary> the python >>> prompt comes up in any DOS windows when
 Gary> running with the -dTkAgg option after the Tk plot window
 Gary> displays. Closing the window then leaves the python prompt
 Gary> and I have to ^Z it to shut it down. It's like it thinks it
 Gary> should be running in interactive mode, although 'interactive
 Gary> : False' is set in my .matplotlibrc This seems abnormal to
 Gary> me.
This is intentional. Since Tkinter doesn't have a mainloop, we switch
python to interactive mode after TkAgg finishes it's business and the
Tk window remains open until the python shell is closed.
 Gary> In my original post I asked if anyone else had success or
 Gary> problems in Win98 and since noone replied, maybe we can
 Gary> assume that I'm one of the rare users who's still using
 Gary> it. Therefore, as much as I (and probably you) would like to
 Gary> get to the bottom of what's happening, it's probably Win98
 Gary> specific and therefore, can probably wait; at least until
 Gary> after my upcoming exams are over and I get a chance to
I would be surprised if it's win98 specific. I haven't seen any
problems so far that were specific to just one windows OS. They're
basically all the same as far as I can see, Microsoft just keeps
shrinkwrapping them and recharging you for them :-) I have win98 at
home so I'll try and test a version there.
 Gary> really look into it some more. So I might go quiet for a few
 Gary> weeks unless you want me to try anything quick and specific.
 Gary> Finally, I hope you didn't lose the ecolor changes I made to
 Gary> errorbars and they might make it into a future version :-)
No, I missed them the first time but when cleaning out my inbox found
them and made an entry on the TODO list, so they'll get merged soon
enough. Thanks.
If you could try the command shell test with GTKAgg that I asked for
above, that would be great.
JDH
From: Gary R. <ga...@em...> - 2004年05月25日 11:08:00
Hi John,
I probably didn't make it clear, but TkAgg has problems too.
Here's what I know:
Under 0.53.1 TkAgg and GTKAgg both worked fine, both when running the script directly from Windows Explorer in which case file association cause python to fire up in a DOS shell, and when running it from within SciTE or IDLE things are fine too. 0.54 has changed something. I tried grabbing and running a few examples from CVS as well as my own previously working examples. They behave consistently - GTKAgg no longer works at all and TkAgg works but only if I run it from DOS with a -dTkAgg option.
It may be a GUI conflict but it has only started to conflict with 0.54.
removing show() or replacing it with show(mainloop=False) seem to make no difference to the behaviour running TkAgg from SciTE.
I do notice that the python >>> prompt comes up in any DOS windows when running with the -dTkAgg option after the Tk plot window displays. Closing the window then leaves the python prompt and I have to ^Z it to shut it down. It's like it thinks it should be running in interactive mode, although 'interactive : False' is set in my .matplotlibrc
This seems abnormal to me.
In my original post I asked if anyone else had success or problems in Win98 and since noone replied, maybe we can assume that I'm one of the rare users who's still using it. Therefore, as much as I (and probably you) would like to get to the bottom of what's happening, it's probably Win98 specific and therefore, can probably wait; at least until after my upcoming exams are over and I get a chance to really look into it some more. So I might go quiet for a few weeks unless you want me to try anything quick and specific.
Finally, I hope you didn't lose the ecolor changes I made to errorbars and they might make it into a future version :-)
regards,
Gary
-- 
___________________________________________________________
Sign-up for Ads Free at Mail.com
http://promo.mail.com/adsfreejump.htm
1 message has been excluded from this view by a project administrator.

Showing 7 results of 7

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