When I set array to QuadMesh collection and mouse over the image, this error log is produced
Traceback (most recent call last):
File "/home/simons/sdat/lib/python3.9/site-packages/matplotlib/cbook/init.py", line 287, in process
func(*args, **kwargs)
File "/home/simons/sdat/lib/python3.9/site-packages/matplotlib/backend_bases.py", line 3061, in mouse_move
s = self._mouse_event_to_message(event)
File "/home/simons/sdat/lib/python3.9/site-packages/matplotlib/backend_bases.py", line 3051, in _mouse_event_to_message
data = a.get_cursor_data(event)
File "/home/simons/sdat/lib/python3.9/site-packages/matplotlib/collections.py", line 2214, in get_cursor_data
return self.get_array()[ind]
File "/home/simons/sdat/lib/python3.9/site-packages/numpy/ma/core.py", line 3220, in getitem
dout = self.data[indx]
IndexError: index 98 is out of bounds for axis 0 with size 10
Expected outcome
Additional information
This happend only when i set_array to existing QuadMesh.
Operating system
Ubunto 20.04
Matplotlib Version
3.5.1
Matplotlib Backend
No response
Python version
No response
Jupyter version
No response
Installation
No response
The text was updated successfully, but these errors were encountered:
Stassels
changed the title
[Bug]:
[Bug]: Data under cursor crashes on QuadMesh
Jan 27, 2022
I can't reproduce this on main because that section of code is now turned off by default I think. The underlying issue here is that the set_array() call doesn't flatten the array, but the initial pcolormesh(z) does. qmesh.get_array().shape is different between the two cases.
I think quadmesh should only support 2D params to set_array; this would be consistent with what's done in the constructor for coords (the old API, where coords is flattened, is likewise being deprecated right now); this would avoid these kinds of issues. Or at least, we should internally store the array as 2D. But @tacaswell didn't really like that in https://github.com/matplotlib/matplotlib/pull/16908/files#r399894236...
Bug summary
Matplotlib 3.5.1
Code for reproduction
Actual outcome
When I set array to QuadMesh collection and mouse over the image, this error log is produced
Expected outcome
Additional information
This happend only when i set_array to existing QuadMesh.
Operating system
Ubunto 20.04
Matplotlib Version
3.5.1
Matplotlib Backend
No response
Python version
No response
Jupyter version
No response
Installation
No response
The text was updated successfully, but these errors were encountered: