Re: [matplotlib-devel] Ginput bug

2008-09-12 Thread David Kaplan
Hi,

I just tried ginput with the latest SVN (gtkagg backend) and it seemed
to work fine.  I recently have had problems with numpy, scipy,
matplotlib and/or wx getting out of sync in terms of binary
compatibility.  Perhaps a rebuild of one or more of those will fix
things for you?

Cheers,
David

On Thu, 2008-09-11 at 11:13 -0700,
[EMAIL PROTECTED] wrote:
> Message: 2
> Date: Tue, 9 Sep 2008 17:18:05 +0200
> From: " St?fan van der Walt " <[EMAIL PROTECTED]>
> Subject: [matplotlib-devel] Ginput bug
> To: [EMAIL PROTECTED]
> Message-ID:
> <[EMAIL PROTECTED]>
> Content-Type: text/plain; charset=ISO-8859-1
> 
> Hi all,
> 
> I noticed that `ginput` no longer works (tested with SVN trunk).  Is
> this a known problem?
> 
> Kind regards,
> St?fan
> 
> ---
> PyDeadObjectError Traceback (most recent call
> last)
> 
> /Users/stefan/ in ()
> 
> /Users/stefan/lib/python2.5/site-packages/matplotlib/pyplot.pyc in
> ginput(*args, **kwargs)
> 353 If *timeout* is negative, does not timeout.
> 354 """
> --> 355 return gcf().ginput(*args, **kwargs)
> 356 if Figure.ginput.__doc__ is not None:
> 357 ginput.__doc__ = dedent(Figure.ginput.__doc__)
> 
> /Users/stefan/lib/python2.5/site-packages/matplotlib/figure.pyc in
> ginput(self, n, timeout, show_clicks)
>1039 blocking_mouse_input = BlockingMouseInput(self)
>1040 return blocking_mouse_input(n=n, timeout=timeout,
> -> 1041 show_clicks=show_clicks)
>1042
>1043 def waitforbuttonpress(self, timeout=-1):
> 
> /Users/stefan/lib/python2.5/site-packages/matplotlib/blocking_input.pyc
> in __call__(self, n, timeout, show_clicks)
> 235 self.clicks  = []
> 236 self.marks   = []
> --> 237 BlockingInput.__call__(self,n=n,timeout=timeout)
> 238
> 239 return self.clicks
> 
> /Users/stefan/lib/python2.5/site-packages/matplotlib/blocking_input.pyc
> in __call__(self, n, timeout)
> 105 finally: # Run even on exception like ctrl-c
> 106 # Disconnect the callbacks
> --> 107 self.cleanup()
> 108
> 109 # Return the events in this case
> 
> /Users/stefan/lib/python2.5/site-packages/matplotlib/blocking_input.pyc
> in cleanup(self)
> 222 mark.remove()
> 223 self.marks = []
> --> 224 self.fig.canvas.draw()
> 225
> 226 # Call base class to remove callbacks
> 
> /opt/local/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/wx-2.8-mac-unicode/wx/_core.pyc
> in __getattr__(self, *args)
>   14312 if not hasattr(self, "_name"):
>   14313 self._name = "[unknown]"
> > 14314 raise PyDeadObjectError(self.attrStr % self._name)
>   14315
>   14316 def __nonzero__(self):
> 
> PyDeadObjectError: The C++ part of the FigureCanvasWxAgg object has
> been deleted, attribute access no longer allowed.
> 
> 
-- 
**
David M. Kaplan
Charge de Recherche 1
Institut de Recherche pour le Developpement
Centre de Recherche Halieutique Mediterraneenne et Tropicale
av. Jean Monnet
B.P. 171
34203 Sete cedex
France

Phone: +33 (0)4 99 57 32 27
Fax: +33 (0)4 99 57 32 95
http://www.ur097.ird.fr/team/dkaplan/index.html
**


-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
___
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] problems with labeling contour lines in 0.98.3

2008-09-12 Thread David Kaplan
Hi,

Yes, I have fixed the problem in my version of matplotlib, but I haven't
had the time to look over all of my changes and commit them to SVN.
Next week things should get better.  If you are really in a hurry, you
can try applying the attached patch set to SVN, but better to wait and
let me make sure it is all kosher.

Cheers,
David


On Fri, 2008-09-12 at 11:29 +0200, Mark Bakker wrote:
> Hello David -
> 
> Sorry for the late reply. I am back from vacation.
> 
> Any luck on solving the problem of the disappearing contour lines when
> labelling? It works fine when you don't use the 'inline', but the
> picture is of course not as nice, as the labels are not in-line
> anymore. Maybe that gives a clue to what goes wrong?
> 
> Thanks, Mark
> 
> On Wed, Sep 3, 2008 at 12:47 PM, David M. Kaplan <[EMAIL PROTECTED]>
> wrote:
> Hi,
> 
> Back from vacation.  The problem with not being able to end
> point
> selection is easy to fix - allow keyboard clicks to also
> select points
> and enter to also exit (this is the solution matlab uses).
>  This is easy
> to add and I will try to work on it sometime over the next
> couple of
> weeks.
> 
> I will try your example sometime soon and see what happens.
>  It sounds
> like the problem has something to do with what happens when
> the label
> covers the entire contour - currently the contour gets deleted
> entirely,
> but this seems to be doing something strange in your case.
> 
> Cheers,
> David
> 
> 
> 
> On Thu, 2008-08-21 at 16:02 +0200, Mark Bakker wrote:
> > David -
> >
> > Enjoy your vacation.
> >
> > I tried the contour_label_demo and it works fine, but my
> problem
> > remains.
> >
> > I suggest you try the example I provided below, and notice
> the
> > difference between labeling with inline=True and
> inline=False. When
> > inline=True the contours in the middle part (which don't get
> labeled,
> > presumably because there isn't enough room) get erased.
> >
> > I figured out the manual input problem. The trick is that
> you require
> > to press the middle button to end (I'll do a post to the
> user's list).
> > Many laptops don't have a middle button. Although
> suggestions are
> > found on the web that pushing both buttons simultaneously
> works, I
> > have never seen it work. What you have to do is configure
> your
> > touchpad such that a corner acts as the middle button. Once
> I figured
> > that out, I could end manually selecting the labels. Very
> nice. If I
> > may, I strongly recommend you change the code such that
> pushing the
> > right button ends the manual input. Is there any reason not
> to use the
> > right button for that?
> >
> > I hope you can fix the inline problem. Thanks for all the
> other new
> > cool features,
> >
> > Mark
> >
> > On Tue, Aug 19, 2008 at 4:06 PM, <[EMAIL PROTECTED]> wrote:
> > Hi,
> >
> > I am currently on vacation, so I can´t be of much
> help - back
> > beginning of next month.  It would be useful if
> > you could try the clabel and ginput demo scripts and
> send
> > images of the resulting figures so that we can
> determine
> > exactly what things work and don´t work.
> >
> > Thanks,
> > David
> >
> >
> >
> > Mark Bakker <[EMAIL PROTECTED]> ha escrito:
> >
> >
> >
> > Hello David and the developers list-
> >
> > I have had little luck on the mailing list,
> so sorry
> > for writing you
> > directly (David may be on vacation).
> >
> > I have two problems labeling contour lines
> in 0.98.3.
> >
> > First, when I call clabel, it removes all
> contours
> > that are not labeled
> > (because the label doesn't fit on the
> section of
> > contour, I presume).
> > This seems like a bug to me (or a really odd
> feature).
> > It doesn't do this
> > when inline = False, but I don't think it
> should do it
> > either when inline =
> > True
> > 

Re: [matplotlib-devel] problems with labeling contour lines in 0.98.3

2008-09-12 Thread Mark Bakker
Hello David -

Sorry for the late reply. I am back from vacation.

Any luck on solving the problem of the disappearing contour lines when
labelling? It works fine when you don't use the 'inline', but the picture is
of course not as nice, as the labels are not in-line anymore. Maybe that
gives a clue to what goes wrong?

Thanks, Mark

On Wed, Sep 3, 2008 at 12:47 PM, David M. Kaplan <[EMAIL PROTECTED]>wrote:

> Hi,
>
> Back from vacation.  The problem with not being able to end point
> selection is easy to fix - allow keyboard clicks to also select points
> and enter to also exit (this is the solution matlab uses).  This is easy
> to add and I will try to work on it sometime over the next couple of
> weeks.
>
> I will try your example sometime soon and see what happens.  It sounds
> like the problem has something to do with what happens when the label
> covers the entire contour - currently the contour gets deleted entirely,
> but this seems to be doing something strange in your case.
>
> Cheers,
> David
>
>
> On Thu, 2008-08-21 at 16:02 +0200, Mark Bakker wrote:
> > David -
> >
> > Enjoy your vacation.
> >
> > I tried the contour_label_demo and it works fine, but my problem
> > remains.
> >
> > I suggest you try the example I provided below, and notice the
> > difference between labeling with inline=True and inline=False. When
> > inline=True the contours in the middle part (which don't get labeled,
> > presumably because there isn't enough room) get erased.
> >
> > I figured out the manual input problem. The trick is that you require
> > to press the middle button to end (I'll do a post to the user's list).
> > Many laptops don't have a middle button. Although suggestions are
> > found on the web that pushing both buttons simultaneously works, I
> > have never seen it work. What you have to do is configure your
> > touchpad such that a corner acts as the middle button. Once I figured
> > that out, I could end manually selecting the labels. Very nice. If I
> > may, I strongly recommend you change the code such that pushing the
> > right button ends the manual input. Is there any reason not to use the
> > right button for that?
> >
> > I hope you can fix the inline problem. Thanks for all the other new
> > cool features,
> >
> > Mark
> >
> > On Tue, Aug 19, 2008 at 4:06 PM, <[EMAIL PROTECTED]> wrote:
> > Hi,
> >
> > I am currently on vacation, so I can´t be of much help - back
> > beginning of next month.  It would be useful if
> > you could try the clabel and ginput demo scripts and send
> > images of the resulting figures so that we can determine
> > exactly what things work and don´t work.
> >
> > Thanks,
> > David
> >
> >
> >
> > Mark Bakker <[EMAIL PROTECTED]> ha escrito:
> >
> >
> >
> > Hello David and the developers list-
> >
> > I have had little luck on the mailing list, so sorry
> > for writing you
> > directly (David may be on vacation).
> >
> > I have two problems labeling contour lines in 0.98.3.
> >
> > First, when I call clabel, it removes all contours
> > that are not labeled
> > (because the label doesn't fit on the section of
> > contour, I presume).
> > This seems like a bug to me (or a really odd feature).
> > It doesn't do this
> > when inline = False, but I don't think it should do it
> > either when inline =
> > True
> > Easy example:
> >
> > x,y =
> > meshgrid( linspace(-10,10,50),
> > linspace(-10,10,50) )
> > z = log(x**2 + y**2)
> > cobj = contour(x,y,z) # Note
> > that there are 8 contours
> > levels (11
> > contour sections in all)
> > cobj.clabel()
> > 
> > draw()  # Now only 5 contours
> > are drawn; the ones in the
> > middle are
> > removed.
> >
> > Second, when using the new manual labeling of contour
> > labels (which is
> > pretty neat!), how do I end this feature?
> > The doc string says: right click, or potentially click
> > both mouse buttons
> > together (which already worries me).
> > Neither works for me on win32, mpl 0.98.3, TkAgg
> > backend, interactive mode.
> > Does anybody have a solution?
> >
> > Thanks, Mark
> >
> >

Re: [matplotlib-devel] xticklabels

2008-09-12 Thread Manuel Metz
> Hi,
>I think there is bug in get_xticklabels(). According to the doc it 
> should return a list of Text instances, instead it returns a list of 
> TextWithDash instances. This also makes the following impossible (which 
> should work of course):
> 
> xtl = ax.get_xticklabels()
> ax.set_xticklabels(xtl)
> 
> Manuel

I just opened a bug #2107138 report to make sure that this is not 
forgotten. I currently have no time to look at this myself :-(

-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
___
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] fancy box around text

2008-09-12 Thread John Hunter
On Thu, Sep 11, 2008 at 4:19 PM, Jae-Joon Lee <[EMAIL PROTECTED]> wrote:
> Thanks John,
>
> I'm afraid that I'm not quite sure what you're suggesting, and will be
> grateful if you describe it more specifically.

Sorry Jae-Joon -- I was in a big hurry yesterday (in the financial
industry we're a bit busy these days) and I forgot that the
mind_reader module had not yet been committed to svn.

First, I'd like to say that these boxes look really nice, and I think
they enhance presentation charts in many contexts (eg business
presentations) so thanks a lot for contributing them.

I think the best organization is to put all of this functionality
(including the textbox code) into text.py and have the default text
instance support both the standard text box (Rectangle) and the
enhanced ones you have provided.   So basically, just your text.py
patch and move all the support code into text.py.  I'd also like to
put your example file in the pylab examples directory and add it to
examples/tests/backend_driver.py.

If you can do all that and submit it as a sf patch, that would be
great.  Alternatively, if you would like to send me your sf id, I can
add you as a developer and you can contribute it directly.

Thanks again,
JDH

JDH

-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
___
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] fancy box around text

2008-09-12 Thread Jae-Joon Lee
Thanks John,

I think I'd better use a sf patch initially so that you or others can
review and improve it. I'll definitely need some help with
documentation as my English can be horrible sometime. On the other
hand, it would be much easier for me to do some maintenance work if I
can commit the changes directly. So, my sf id is "leejjoon" and it
will be great if you add me as a developer.

 I guess this fancy box thing can be used with other artist objects
also, although the legend object is an only object I can think of now.
And my personal inclination is put those support code into patches.py
and have a patch class around it, i.e., a FancyBoxPatch class which is
initialized with bbox-like object and draw a fancy box around the
given bbox. And let the Text and the Legend class use this
FancyBoxPatch. In the current matplotlib, both the Text and the Legend
class uses the Patch class for drawing a bbox. So how do you think?

What I also want to see in matplotlib is a fancy annotation. I have
some working code (although I'm planning some major code
reorganization) and willing to contribute it if there is an interest
(see the attached example). As you can easily guess, the fancy
annotation share some of its core with the fancy box. So if you're
also willing to include the fancy annotation things in matplotlib,
I'll put some more effort in the code reorganization so that it can
nicely fit in the current matplotlib classes.

Regards,

-JJ

ps. I just wanted to mention that implementing these fancy boxes
became possible with the bezier path support in matplotlib.  So my
thanks to Michael.


On Fri, Sep 12, 2008 at 11:45 AM, John Hunter <[EMAIL PROTECTED]> wrote:
> On Thu, Sep 11, 2008 at 4:19 PM, Jae-Joon Lee <[EMAIL PROTECTED]> wrote:
>> Thanks John,
>>
>> I'm afraid that I'm not quite sure what you're suggesting, and will be
>> grateful if you describe it more specifically.
>
> Sorry Jae-Joon -- I was in a big hurry yesterday (in the financial
> industry we're a bit busy these days) and I forgot that the
> mind_reader module had not yet been committed to svn.
>
> First, I'd like to say that these boxes look really nice, and I think
> they enhance presentation charts in many contexts (eg business
> presentations) so thanks a lot for contributing them.
>
> I think the best organization is to put all of this functionality
> (including the textbox code) into text.py and have the default text
> instance support both the standard text box (Rectangle) and the
> enhanced ones you have provided.   So basically, just your text.py
> patch and move all the support code into text.py.  I'd also like to
> put your example file in the pylab examples directory and add it to
> examples/tests/backend_driver.py.
>
> If you can do all that and submit it as a sf patch, that would be
> great.  Alternatively, if you would like to send me your sf id, I can
> add you as a developer and you can contribute it directly.
>
> Thanks again,
> JDH
>
> JDH
>
<>-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/___
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] fancy box around text

2008-09-12 Thread Michael Droettboom
Jae-Joon Lee wrote:
>  I guess this fancy box thing can be used with other artist objects
> also, although the legend object is an only object I can think of now.
> And my personal inclination is put those support code into patches.py
> and have a patch class around it, i.e., a FancyBoxPatch class which is
> initialized with bbox-like object and draw a fancy box around the
> given bbox. And let the Text and the Legend class use this
> FancyBoxPatch. In the current matplotlib, both the Text and the Legend
> class uses the Patch class for drawing a bbox. So how do you think?
>   
I like this suggestion.  I can see this being generally useful.
> What I also want to see in matplotlib is a fancy annotation. I have
> some working code (although I'm planning some major code
> reorganization) and willing to contribute it if there is an interest
> (see the attached example). As you can easily guess, the fancy
> annotation share some of its core with the fancy box. So if you're
> also willing to include the fancy annotation things in matplotlib,
> I'll put some more effort in the code reorganization so that it can
> nicely fit in the current matplotlib classes.
>   
Looking forward to it.
> ps. I just wanted to mention that implementing these fancy boxes
> became possible with the bezier path support in matplotlib.  So my
> thanks to Michael.
>   
You're welcome.  It's nice to see others picking this stuff up and 
running with it.

Cheers,
Mike
>
> On Fri, Sep 12, 2008 at 11:45 AM, John Hunter <[EMAIL PROTECTED]> wrote:
>   
>> On Thu, Sep 11, 2008 at 4:19 PM, Jae-Joon Lee <[EMAIL PROTECTED]> wrote:
>> 
>>> Thanks John,
>>>
>>> I'm afraid that I'm not quite sure what you're suggesting, and will be
>>> grateful if you describe it more specifically.
>>>   
>> Sorry Jae-Joon -- I was in a big hurry yesterday (in the financial
>> industry we're a bit busy these days) and I forgot that the
>> mind_reader module had not yet been committed to svn.
>>
>> First, I'd like to say that these boxes look really nice, and I think
>> they enhance presentation charts in many contexts (eg business
>> presentations) so thanks a lot for contributing them.
>>
>> I think the best organization is to put all of this functionality
>> (including the textbox code) into text.py and have the default text
>> instance support both the standard text box (Rectangle) and the
>> enhanced ones you have provided.   So basically, just your text.py
>> patch and move all the support code into text.py.  I'd also like to
>> put your example file in the pylab examples directory and add it to
>> examples/tests/backend_driver.py.
>>
>> If you can do all that and submit it as a sf patch, that would be
>> great.  Alternatively, if you would like to send me your sf id, I can
>> add you as a developer and you can contribute it directly.
>>
>> Thanks again,
>> JDH
>>
>> JDH
>>
>> 
>>
>> 
>>
>> 
>>
>> -
>> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
>> Build the coolest Linux based applications with Moblin SDK & win great prizes
>> Grand prize is a trip for two to an Open Source event anywhere in the world
>> http://moblin-contest.org/redirect.php?banner_id=100&url=/
>> 
>>
>> ___
>> Matplotlib-devel mailing list
>> Matplotlib-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-devel
>> 

-- 
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA


-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
___
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] fancy box around text

2008-09-12 Thread John Hunter
On Fri, Sep 12, 2008 at 2:46 PM, Jae-Joon Lee <[EMAIL PROTECTED]> wrote:
> Thanks John,
>
> I think I'd better use a sf patch initially so that you or others can
> review and improve it. I'll definitely need some help with
> documentation as my English can be horrible sometime. On the other
> hand, it would be much easier for me to do some maintenance work if I
> can commit the changes directly. So, my sf id is "leejjoon" and it
> will be great if you add me as a developer.

OK, I added you as a developer, but you continue posting your patches
here and we will be happy to review and comment on them as we have
time.


>  I guess this fancy box thing can be used with other artist objects
> also, although the legend object is an only object I can think of now.
> And my personal inclination is put those support code into patches.py
> and have a patch class around it, i.e., a FancyBoxPatch class which is
> initialized with bbox-like object and draw a fancy box around the
> given bbox. And let the Text and the Legend class use this
> FancyBoxPatch. In the current matplotlib, both the Text and the Legend
> class uses the Patch class for drawing a bbox. So how do you think?

Yes, if you can generalize it to a Patch instance this will be more
useful and then matplotlib.patches will be the place for it.
I notice that your current TextBoxArtist does not actually derive from
matplotlib.artist.Artist.  If you intend it to be an Artist, you
should explictly inherit and implement draw and other required methods
(eg get_children if your Artist contains other artists)

> What I also want to see in matplotlib is a fancy annotation. I have
> some working code (although I'm planning some major code
> reorganization) and willing to contribute it if there is an interest
> (see the attached example). As you can easily guess, the fancy
> annotation share some of its core with the fancy box. So if you're
> also willing to include the fancy annotation things in matplotlib,
> I'll put some more effort in the code reorganization so that it can
> nicely fit in the current matplotlib classes.

These examples look very nice too!  Send in a patch when you have
everything organized.

JDH

-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
___
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel