Skip to content

[Bug]: stop responding in demo program "matplotlib/examples/event_handling/lasso_demo.py" #25137

Closed

Description

@Igittigitt24

Bug summary

The demo shows some points. You may surround some of them with a "lasso" (pressing the left mouse button an moving the cursor arround) and then these points are displayed in a different colour. Trying another lasso, other points will be coloured and so on.
But if you just click the left mouse button once and DO NOT MOVE THE CURSOR, then the program hangs and no other lassos can be thrown.

Code for reproduction

just matplotlib/examples/event_handling/lasso_demo.py
just try

Actual outcome

none, as described in bug summary

Expected outcome

The program should ignore such a behaviour (only click one + no move) and then should produce a correct set of coloured points on a further lasso example.

Additional information

The function "lasso" does not recognize, that NO movement happens.
But in the demo file after EVERY lasso call a
# acquire a lock on the widget drawing
self.canvas.widgetlock(self.lasso)

is executed, so that the program is unable to receive another "lasso" if the error mentioned above appears.

Operating system

win 10

Matplotlib Version

3.5.1

Matplotlib Backend

TkAgg

Python version

3.8.10

Jupyter version

No response

Installation

pip

Activity

  1. added this to the v3.8.0 milestone on Feb 2, 2023
  2. Igittigitt24 commented on Feb 4, 2023

    @Igittigitt24
    Author

    a) Function lasso should return the boolean value "a legal lasso has been thrown", so that in (in case True) a self.canvas.widgetlock(self.lasso) whoul make sense.
    b) Function lasso itself should call canvas.widgetlock(), because ist has to be done anyway (if the is a real lasso drawn); a new parameter canvas must be passed over to function lasso.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions