SourceForge logo
SourceForge logo
Menu

matplotlib-devel

From: Abraham S. <ab...@cn...> - 2005年09月13日 16:07:30
Is there a reason that for the GTK backend gtk.DrawingArea was used 
instead of gtk.Layout? As far as I can tell gtk.Layout can do everything 
that gtk.DrawingArea can, but has the additional advantage that you can 
place widgets on the canvas, which can be extremely useful. I tried a 
quick patch (which I can send if anyone wants), where I got it working 
fine. The main changes (there aren't many) are where changes to the 
window would be make, 'self.window' needs to be replaced with 
'self.bin_window', and I also found I had to connect to the 
'size-allocate' event to have it properly redrawwhen the window size 
changed.
As a side note, one feature that this might allow, would be to allow for 
matplotlib-widgets to be drawn using the GTK if the backend were 
detected (much like how SWT, for Eclipse works).
Also, on a complete tanget, does anyone know of a good method of saving 
animations done in MPL? The only two methods that I can think of right 
now are to (1) interface with matlab, or (2) save each frame, and create 
an animated gif. As my movies are fairly large, neither seem like a 
great option.
After searching around some, I found pymedia, but when I try to import 
it, all it manages to do is crash. While a SWIG interface could be 
created for FFMPEG, it would be nice if there were some other option.
Thanks,
Abe
From: John H. <jdh...@ac...> - 2005年09月14日 14:52:14
>>>>> "Abraham" == Abraham Schneider <ab...@cn...> writes:
 Abraham> Is there a reason that for the GTK backend
 Abraham> gtk.DrawingArea was used instead of gtk.Layout? As far as
 Abraham> I can tell gtk.Layout can do everything that
 Abraham> gtk.DrawingArea can, but has the additional advantage
 Abraham> that you can place widgets on the canvas, which can be
 Abraham> extremely useful. I tried a quick patch (which I can send
 Abraham> if anyone wants), where I got it working fine. The main
 Abraham> changes (there aren't many) are where changes to the
 Abraham> window would be make, 'self.window' needs to be replaced
 Abraham> with 'self.bin_window', and I also found I had to connect
 Abraham> to the 'size-allocate' event to have it properly
 Abraham> redrawwhen the window size changed.
 Abraham> As a side note, one feature that this might allow, would
 Abraham> be to allow for matplotlib-widgets to be drawn using the
 Abraham> GTK if the backend were detected (much like how SWT, for
 Abraham> Eclipse works).
This sounds useful -- could you post a patch against CVS on the
sourceforge site (and email here when it is up) so we can test it.
I think the only reason that this wasn't used initially was ignorance
on my part. I was hoping I could blame version numbers, that this
wasn't available in pygtk 1.99.16 when mpl was released, but on quick
inspection this explanation does not appear to hold water.
 Abraham> Also, on a complete tanget, does anyone know of a good
 Abraham> method of saving animations done in MPL? The only two
 Abraham> methods that I can think of right now are to (1)
 Abraham> interface with matlab, or (2) save each frame, and create
 Abraham> an animated gif. As my movies are fairly large, neither
 Abraham> seem like a great option.
 Abraham> After searching around some, I found pymedia, but when I
 Abraham> try to import it, all it manages to do is crash. While a
 Abraham> SWIG interface could be created for FFMPEG, it would be
 Abraham> nice if there were some other option.
Something like this could usefully be placed in a toolkit following
the basemap model, where adding an extra layer of extension code
doesn't pose any installation or distribution woes for the core. I
think it would be useful.
In the meantime, I typically save a series of PNGs and convert them to
MPEG using image magick's "convert" or mencoder.
 http://matplotlib.sourceforge.net/faq.html#MOVIE
See also examples/movie_demo.py.
If you come up with other/better alternatives, let us know.
JDH
From: Abraham S. <ab...@cn...> - 2005年09月14日 16:41:59
Okay, here's the patch. I'm also including a quick demo with a button 
that gets added directly to the canvas.
On a side note, I can't get the CVS version to work under ipython, and 
get this error (it was working fine with 0.83.2):
---------------------------------------------------------------------------
exceptions.SystemError Traceback (most 
recent call last)
SystemError: Objects/moduleobject.c:48: bad argument to internal function
Segmentation fault
Abe
John Hunter wrote:
>>>>>>"Abraham" == Abraham Schneider <ab...@cn...> writes:
>>>>>> 
>>>>>>
>
> Abraham> Is there a reason that for the GTK backend
> Abraham> gtk.DrawingArea was used instead of gtk.Layout? As far as
> Abraham> I can tell gtk.Layout can do everything that
> Abraham> gtk.DrawingArea can, but has the additional advantage
> Abraham> that you can place widgets on the canvas, which can be
> Abraham> extremely useful. I tried a quick patch (which I can send
> Abraham> if anyone wants), where I got it working fine. The main
> Abraham> changes (there aren't many) are where changes to the
> Abraham> window would be make, 'self.window' needs to be replaced
> Abraham> with 'self.bin_window', and I also found I had to connect
> Abraham> to the 'size-allocate' event to have it properly
> Abraham> redrawwhen the window size changed.
>
>
> Abraham> As a side note, one feature that this might allow, would
> Abraham> be to allow for matplotlib-widgets to be drawn using the
> Abraham> GTK if the backend were detected (much like how SWT, for
> Abraham> Eclipse works).
>
>
>This sounds useful -- could you post a patch against CVS on the
>sourceforge site (and email here when it is up) so we can test it.
>I think the only reason that this wasn't used initially was ignorance
>on my part. I was hoping I could blame version numbers, that this
>wasn't available in pygtk 1.99.16 when mpl was released, but on quick
>inspection this explanation does not appear to hold water.
>
> Abraham> Also, on a complete tanget, does anyone know of a good
> Abraham> method of saving animations done in MPL? The only two
> Abraham> methods that I can think of right now are to (1)
> Abraham> interface with matlab, or (2) save each frame, and create
> Abraham> an animated gif. As my movies are fairly large, neither
> Abraham> seem like a great option.
>
> Abraham> After searching around some, I found pymedia, but when I
> Abraham> try to import it, all it manages to do is crash. While a
> Abraham> SWIG interface could be created for FFMPEG, it would be
> Abraham> nice if there were some other option.
>
>Something like this could usefully be placed in a toolkit following
>the basemap model, where adding an extra layer of extension code
>doesn't pose any installation or distribution woes for the core. I
>think it would be useful.
>
>In the meantime, I typically save a series of PNGs and convert them to
>MPEG using image magick's "convert" or mencoder.
>
> http://matplotlib.sourceforge.net/faq.html#MOVIE
>
>See also examples/movie_demo.py.
>
>If you come up with other/better alternatives, let us know.
>
>JDH
>
>
>-------------------------------------------------------
>SF.Net email is sponsored by:
>Tame your development challenges with Apache's Geronimo App Server. Download
>it for free - -and be entered to win a 42" plasma tv or your very own
>Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php
>_______________________________________________
>Matplotlib-devel mailing list
>Mat...@li...
>https://lists.sourceforge.net/lists/listinfo/matplotlib-devel
> 
>
From: John H. <jdh...@ac...> - 2005年09月14日 16:49:39
>>>>> "Abraham" == Abraham Schneider <ab...@cn...> writes:
 Abraham> Okay, here's the patch. I'm also including a quick demo
 Abraham> with a button that gets added directly to the canvas.
OK, great. Steve could you take a look at this when you get a minute
and give some feedback about whether you think this is a god idea.
 Abraham> On a side note, I can't get the CVS version to work under
 Abraham> ipython, and get this error (it was working fine with
 Abraham> 0.83.2):
 Abraham> ---------------------------------------------------------------------------
 Abraham> exceptions.SystemError Traceback (most recent call last)
 Abraham> SystemError: Objects/moduleobject.c:48: bad argument to
 Abraham> internal function Segmentation fault
Have you done the standard clean install
 > sudo rm -rf build /your/path/to/site-packages/matplotlib
 > sudo python setup.py install
I recently upgraded pycxx in CVS and my first guess is you have some stale
object code lying around.
JDH
From: Abraham S. <ab...@cn...> - 2005年09月14日 17:50:38
Just tried the 'rm -fr ...../site-packages/matplotlib', and I still get 
the same behavior. Also, if that were the cause, then shouldn't it also 
crash outside of ipython as well?
John Hunter wrote:
>>>>>>"Abraham" == Abraham Schneider <ab...@cn...> writes:
>>>>>> 
>>>>>>
>
> Abraham> Okay, here's the patch. I'm also including a quick demo
> Abraham> with a button that gets added directly to the canvas.
>
>OK, great. Steve could you take a look at this when you get a minute
>and give some feedback about whether you think this is a god idea.
>
> Abraham> On a side note, I can't get the CVS version to work under
> Abraham> ipython, and get this error (it was working fine with
> Abraham> 0.83.2):
> Abraham> ---------------------------------------------------------------------------
> Abraham> exceptions.SystemError Traceback (most recent call last)
>
> Abraham> SystemError: Objects/moduleobject.c:48: bad argument to
> Abraham> internal function Segmentation fault
>
>Have you done the standard clean install
>
> > sudo rm -rf build /your/path/to/site-packages/matplotlib
> > sudo python setup.py install
>
>I recently upgraded pycxx in CVS and my first guess is you have some stale
>object code lying around.
>
>JDH
>
>
>-------------------------------------------------------
>SF.Net email is sponsored by:
>Tame your development challenges with Apache's Geronimo App Server. Download
>it for free - -and be entered to win a 42" plasma tv or your very own
>Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php
>_______________________________________________
>Matplotlib-devel mailing list
>Mat...@li...
>https://lists.sourceforge.net/lists/listinfo/matplotlib-devel
> 
>
From: Fernando P. <Fer...@co...> - 2005年09月14日 17:55:35
Abraham Schneider wrote:
> Just tried the 'rm -fr ...../site-packages/matplotlib', and I still get 
> the same behavior. Also, if that were the cause, then shouldn't it also 
> crash outside of ipython as well?
I should note that I'v also seen this same crash with 0.83.2 official.
I haven't bothered to track it down, because I hardly ever use GTK except when 
testing for problems on the list.
It may not happen outside of ipython, if somehow the crash is triggered by the 
threading tricks which ipython uses to enable GTK interactive use. Nasty...
Cheers,
f
From: John H. <jdh...@ac...> - 2005年09月14日 18:16:53
>>>>> "Fernando" == Fernando Perez <Fer...@co...> writes:
 Fernando> Abraham Schneider wrote:
 >> Just tried the 'rm -fr ...../site-packages/matplotlib', and I
 >> still get the same behavior. Also, if that were the cause, then
 >> shouldn't it also crash outside of ipython as well?
 Fernando> I should note that I'v also seen this same crash with
 Fernando> 0.83.2 official.
 Fernando> I haven't bothered to track it down, because I hardly
 Fernando> ever use GTK except when testing for problems on the
 Fernando> list.
 Fernando> It may not happen outside of ipython, if somehow the
 Fernando> crash is triggered by the threading tricks which ipython
 Fernando> uses to enable GTK interactive use. Nasty...
OK, I just checked the archives. This definitely has cropped up
before on ipython w/ matplotlib under 0.83.2. Steve Schmerler
reported it on the user's list and we had some extensive discussions
on and off list and never found the cause. He eventually just started
using the debian package at which point the bug hunt was terminated.
Fernando, if you can replicate it on your box with your current
install, maybe you can set me up with an account and I'll log in and
see if I can trace it. It looks like it's going to be a
gtk/ipython/matplotlib/threading multi-headed monster.
JDH
From: John H. <jdh...@ac...> - 2005年09月14日 19:48:23
>>>>> "John" == John Hunter <jdh...@ac...> writes:
 John> OK, I just checked the archives. This definitely has
 John> cropped up before on ipython w/ matplotlib under 0.83.2.
 John> Steve Schmerler reported it on the user's list and we had
 John> some extensive discussions on and off list and never found
 John> the cause. He eventually just started using the debian
 John> package at which point the bug hunt was terminated.
 John> Fernando, if you can replicate it on your box with your
 John> current install, maybe you can set me up with an account and
 John> I'll log in and see if I can trace it. It looks like it's
 John> going to be a gtk/ipython/matplotlib/threading multi-headed
 John> monster.
OK, this is getting thornier by the minute. Fernando gave me an
account on his system running mpl 0.83.2 and ipython CVS and I logged
in over X11 and was unable to reproduce the bug. He then logged in as
me locally so we had the same environment and got the crash. 
The only two differences I can see are that I have a different X11
server on my local machine and that the delays may be different since
he is local and I am remote over ssh. So it could be some kind of
nasty GUI timing threading thingie.
If anyone has any ideas that these facts inspirec, fire away.
JDH
From: Nadia D. <den...@st...> - 2005年09月15日 12:52:05
I am using the TkAgg backend and was hesitant to post this since 
everyone agrees that it works,
but I rebuilt mpl from cvs this morning with VERBOSE =True, and 
confirmed that ipython
still crashes. Python works fine.
I am using python 2.4.1, freetype 2.9 on MacOSX with the X11 version 
of Tk.
Here's some of the output of plot().
Nadia
SeparableTransformation::eval_scalars
Affine::eval_scalars
Affine::eval_scalars DONE
Affine::operator
SeparableTransformation::operator
/Users/dencheva/cvs-matplotlib/test-crash/install/matplotlib/ 
font_manager.py:984: UserWarning: Could not match sans-serif, normal, 
normal. Returning 
/Users/dencheva/cvs-matplotlib/test-crash/install/matplotlib/share/ 
matplotlib/Vera.ttf
 warnings.warn('Could not match %s, %s, %s. Returning %s' % (name, 
style, variant, self.defaultFont))
ft2font_module::new_ft2font
FT2Font::FT2Font
FT2Font::clear
FT2Font::setattr
FT2Font::setattr
FT2Font::setattr
FT2Font::setattr
FT2Font::setattr
FT2Font::setattr
FT2Font::setattr
FT2Font::setattr
FT2Font::setattr
FT2Font::setattr
FT2Font::setattr
FT2Font::setattr
FT2Font::setattr
FT2Font::setattr
FT2Font::setattr
FT2Font::setattr
FT2Font::setattr
FT2Font::setattr
FT2Font::setattr
FT2Font::getattr
FT2Font::clear
FT2Font::getattr
Value::get
FT2Font::set_size
FT2Font::getattr
FT2Font::set_text
Bus error
On Sep 14, 2005, at 3:47 PM, John Hunter wrote:
>>>>>> "John" == John Hunter <jdh...@ac...> writes:
>
> John> OK, I just checked the archives. This definitely has
> John> cropped up before on ipython w/ matplotlib under 0.83.2.
> John> Steve Schmerler reported it on the user's list and we had
> John> some extensive discussions on and off list and never found
> John> the cause. He eventually just started using the debian
> John> package at which point the bug hunt was terminated.
>
> John> Fernando, if you can replicate it on your box with your
> John> current install, maybe you can set me up with an account and
> John> I'll log in and see if I can trace it. It looks like it's
> John> going to be a gtk/ipython/matplotlib/threading multi-headed
> John> monster.
>
> OK, this is getting thornier by the minute. Fernando gave me an
> account on his system running mpl 0.83.2 and ipython CVS and I logged
> in over X11 and was unable to reproduce the bug. He then logged in as
> me locally so we had the same environment and got the crash.
>
> The only two differences I can see are that I have a different X11
> server on my local machine and that the delays may be different since
> he is local and I am remote over ssh. So it could be some kind of
> nasty GUI timing threading thingie.
>
> If anyone has any ideas that these facts inspirec, fire away.
>
> JDH
>
>
> -------------------------------------------------------
> SF.Net email is sponsored by:
> Tame your development challenges with Apache's Geronimo App Server. 
> Download
> it for free - -and be entered to win a 42" plasma tv or your very own
> Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php
> _______________________________________________
> Matplotlib-devel mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-devel
From: John H. <jdh...@ac...> - 2005年09月15日 12:57:11
>>>>> "Nadia" == Nadia Dencheva <den...@st...> writes:
 Nadia> I am using the TkAgg backend and was hesitant to post this
 Nadia> since everyone agrees that it works, but I rebuilt mpl from
 Nadia> cvs this morning with VERBOSE =True, and confirmed that
 Nadia> ipython still crashes. Python works fine.
 Nadia> I am using python 2.4.1, freetype 2.9 on MacOSX with the
 Nadia> X11 version of Tk. Here's some of the output of plot().
 Nadia> FT2Font::getattr FT2Font::clear FT2Font::getattr Value::get
 Nadia> FT2Font::set_size FT2Font::getattr FT2Font::set_text Bus
 Nadia> error
So you get this with tkagg. I assume you get this with plain-ol agg
too?
From your verbose output it looks like a ft2font error. Could you use
--verbose-debug which may indicate which font is being loaded before
the crash. We have seen some strangeness with OS X fonts.
JDH
From: Nadia D. <den...@st...> - 2005年09月15日 13:17:13
Attachments: log
> From your verbose output it looks like a ft2font error. Could you use
> --verbose-debug which may indicate which font is being loaded before
> the crash. We have seen some strangeness with OS X fonts.
>
So, ipython does not recognize --verbose-debug, I didn't know that.
python myscript.py --verbose-debug >& log
log is attached.
Thanks,
Nadia
From: John H. <jdh...@ac...> - 2005年09月15日 13:46:43
>>>>> "Nadia" == Nadia Dencheva <den...@st...> writes:
 Nadia> So, ipython does not recognize --verbose-debug, I didn't
 Nadia> know that.
 Nadia> python myscript.py --verbose-debug >& log
Oh you're right, I forgot. And this is an ipython only bug. You can
set the verbose setting to debug in your rc file and then run your
example from ipython to get the verbose output from ipython.
So to clarify after this recent confusion, here are the two things
that it would help to know:
 * from ipython do you get the crash if you set your backend to be Agg
 and issue
 In [1]: plot([1,2,3])
 Out[1]: [<matplotlib.lines.Line2D instance at 0xb6cad26c>]
 In [2]: savefig('test')
 do you see the crash? Of course no figure will be plotted to the
 screen, but the png should be created.
 * If you set VERBOSE=True in setup.py and verbose : 'debug' in rc,
 and issue the plot commands in tkagg from ipython that generates
 the crash, what does the verbose output generate, particularly the
 last 100 lines or so?
JDH
From: Nadia D. <den...@st...> - 2005年09月15日 14:30:15
Attachments: log.verb.debug
>
> * from ipython do you get the crash if you set your backend to be Agg
> and issue
>
> In [1]: plot([1,2,3])
> Out[1]: [<matplotlib.lines.Line2D instance at 0xb6cad26c>]
>
> In [2]: savefig('test')
>
> do you see the crash? Of course no figure will be plotted to the
> screen, but the png should be created
This works and the figure looks good.
> * If you set VERBOSE=True in setup.py and verbose : 'debug' in rc,
> and issue the plot commands in tkagg from ipython that generates
> the crash, what does the verbose output generate, particularly the
> last 100 lines or so?
>
Attached is the log file from
ipython -pylab myscript.py >& log.verb.debug
with VERBOSE = True and verbose=debug.
I dont' understand this. It looks like it failed to find any of the 
fonts, but then
why does the same setup work with python?
And the same setup works with mpl 0.83.2 and ipython, it crashes only 
with
mpl from cvs
Nadia
From: Fernando P. <Fer...@co...> - 2005年09月15日 17:34:17
Nadia Dencheva wrote:
> I dont' understand this. It looks like it failed to find any of the 
> fonts, but then
> why does the same setup work with python?
> And the same setup works with mpl 0.83.2 and ipython, it crashes only 
> with
> mpl from cvs
Just to say that I'm keeping an eye on this, but I have no ipython-specific 
ideas I can contribute. I looked at the log you sent, but no bulb went off in 
my head, sorry.
f
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 によって変換されたページ (->オリジナル) /