Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
Closed
Milestone
Description
Bug summary
This is just a very minor bug I noticed...
When using a QuadMesh without setting an array, the get_cursor_data function throws an error because it does not check if an array has been set.
This is somewhat connected to#22334 but this is just about the case when no array has been set.
Code for reproduction
importmatplotlib.pyplotaspltfrommatplotlib.collectionsimportQuadMeshimportnumpyasnpx,y=np.linspace([-1.5,-1.5], [1.5,1.5],20).TX,Y=np.meshgrid(x,y)coll=QuadMesh(np.stack((X,Y),axis=2))f,ax=plt.subplots()ax.add_collection(coll)
Actual outcome
TypeError: 'NoneType' object is not subscriptableTraceback (most recent call last): File "...\matplotlib\cbook\__init__.py", line 287, in process func(*args, **kwargs) File "...\matplotlib\backend_bases.py", line 3061, in mouse_move s = self._mouse_event_to_message(event) File "...\matplotlib\backend_bases.py", line 3051, in _mouse_event_to_message data = a.get_cursor_data(event) File "...\matplotlib\collections.py", line 2214, in get_cursor_data return self.get_array()[ind]TypeError: 'NoneType' object is not
Expected outcome
no error
Additional information
No response
Operating system
No response
Matplotlib Version
3.5.1
Matplotlib Backend
No response
Python version
No response
Jupyter version
No response
Installation
No response
Metadata
Metadata
Assignees
Labels
No labels