Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e45903c

Browse files
author
James Evans
committed
Convert float parameters to int parameters to 'restore_region'
1 parent 7900ee4 commit e45903c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/matplotlib/backends/backend_agg.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,10 @@ def restore_region(self, region, bbox=None, xy=None):
357357
else:
358358
ox, oy = xy
359359

360-
self._renderer.restore_region(region, x1, y1, x2, y2, ox, oy)
360+
# The incoming data is float, but the _renderer type-checking wants
361+
# to see integers.
362+
self._renderer.restore_region(region, int(x1), int(y1),
363+
int(x2), int(y2), int(ox), int(oy))
361364

362365
else:
363366
self._renderer.restore_region(region)

0 commit comments

Comments
 (0)