Closed arnaudrichard closed 8 months ago
As far as I can see this works in a plain terminal ipython for me, can you give it a try and confirm?
Yes and no: from ipython interpreter, the cursors are deleted, but after I deleted the first one, everytime mouse pointer move there's this error printed in the interpreter:
Traceback (most recent call last): File "C:\Users\richarda\AppData\Local\Programs\Python\Python311\Lib\site-packages\matplotlib\cbook__init__.py", line 304, in process func(*args, **kwargs) File "C:\Users\richarda\AppData\Local\Programs\Python\Python311\Lib\site-packages\matplotlib\offsetbox.py", line 1520, in on_motion if self._check_still_parented() and self.got_artist: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\richarda\AppData\Local\Programs\Python\Python311\Lib\site-packages\matplotlib\offsetbox.py", line 1560, in _check_still_parented self.disconnect() File "C:\Users\richarda\AppData\Local\Programs\Python\Python311\Lib\site-packages\matplotlib\offsetbox.py", line 1568, in disconnect self.canvas.mpl_disconnect(cid) ^^^^^^^^^^^ File "C:\Users\richarda\AppData\Local\Programs\Python\Python311\Lib\site-packages\matplotlib\offsetbox.py", line 1517, in
canvas = property(lambda self: self.ref_artist.figure.canvas) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'NoneType' object has no attribute 'canvas'
Is it linked or a completely different issue?
What are your versions of matplotlib and mplcursors?
Name: matplotlib Version: 3.7.1 Name: mplcursors Version: 0.5.2
Ah yes, there's a known bug in matplotlib 3.7.1 that makes cursor removal problematic (https://github.com/matplotlib/matplotlib/issues/25440). I should make a new release that explicitly checks against that version of matplotlib, but in the meantime you should just update (or downgrade) matplotlib.
Released 0.5.3.
I confirm upgrading matplotlib solved the issue. Thx !
In my JupyterLab environement, I am not able to remove more than once a cursor (using default right-click binding). I mean the first cursor created with a left-click can be removed with a right-click, but after that, next cursors created can't be removed anymore. Is it due to JupyterLab environement or a mplcursors issue?
I tried with the following example: