Skip to content

Commit 3c56f4a

Browse files
BUG: recent numpy fails on non-int shape
1 parent 50f373f commit 3c56f4a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/matplotlib/backends/backend_webagg_core.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ def get_diff_image(self):
207207
# pixels can be compared in one numpy call, rather than
208208
# needing to compare each plane separately.
209209
buff = np.frombuffer(renderer.buffer_rgba(), dtype=np.uint32)
210-
buff.shape = (renderer.height, renderer.width)
210+
buff.shape = (int(renderer.height), int(renderer.width))
211211

212212
# If any pixels have transparency, we need to force a full
213213
# draw as we cannot overlay new on top of old.
@@ -220,7 +220,7 @@ def get_diff_image(self):
220220
self.set_image_mode('diff')
221221
last_buffer = np.frombuffer(self._last_renderer.buffer_rgba(),
222222
dtype=np.uint32)
223-
last_buffer.shape = (renderer.height, renderer.width)
223+
last_buffer.shape = (int(renderer.height), int(renderer.width))
224224

225225
diff = buff != last_buffer
226226
output = np.where(diff, buff, 0)

0 commit comments

Comments
 (0)