problems with labeling contour lines in 0.98.3

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(x2 + y2)
cobj = contour(x,y,z) # Note that there are 8 contours levels (11 contour sections in all)

cobj.clabel()
<a list of 8 text.Text objects>

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

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 <markbak@...149...> 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()

<a list of 8 text.Text objects>

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

----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.

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, <kaplan@…635…> 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 <markbak@…149…> 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(x2 + y2)

cobj = contour(x,y,z) # Note that there are 8 contours levels (11
contour sections in all)

cobj.clabel()
<a list of 8 text.Text objects>

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


This message was sent using IMP, the Internet Messaging Program.

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, <kaplan@...635...> 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 <markbak@...149...> 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()
                <a list of 8 text.Text objects>
                                        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
                
        ----------------------------------------------------------------
        This message was sent using IMP, the Internet Messaging
        Program.
        

--
**********************************
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
**********************************

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 <David.Kaplan@…622…> 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, <kaplan@…635…> 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 <markbak@...149...> 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.](http://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()
            <a list of 8 text.Text objects>
                                    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
    ----------------------------------------------------------------
    This message was sent using IMP, the Internet Messaging
    Program.


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


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

numerical_methods_reorganization_plus_ginput_fix.patch (35.2 KB)

···

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 <David.Kaplan@...622...> > 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, <kaplan@...635...> 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 <markbak@...149...> 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()
        > <a list of 8 text.Text objects>
        > 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
        >
        >
        >
        >
        >
        >
        ----------------------------------------------------------------
        > This message was sent using IMP, the Internet
        Messaging
        > Program.
        >
        >
        >
        
        --
        **********************************
        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
        **********************************
        

--
**********************************
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
**********************************