I am trying to use the RectangleSelector widget.
In the corresponding example
the rectangle selector is activated every time I click inside the axes.
However, I would like to activate it on demand.
For example, suppose there is a choice-box (using a simple gui like easygui).
One of the possible choices would be “select rectangle”.
I would like the RectangleSelector to be activated only after the “select rectangle” option is chosen and deactivated after one rectangle selection.
It should be activated again only after the choice-menu is presented again and the “selected rectangle” option is chosen again.
The MATLAB equivalent to what I need is the command rbbox
It can be activated on demand, in a norma “linear” program and not just in event-driven GUI.
Is there a way to get the same functionality from matplotlib ?