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

Skip to content

Commit d15c344

Browse files
committed
Ensuring both x and y attrs of LocationEvent are int
1 parent 4aec12b commit d15c344

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/matplotlib/backend_bases.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1365,8 +1365,8 @@ def __init__(self, name, canvas, x, y, guiEvent=None):
13651365
*x*, *y* in figure coords, 0,0 = bottom, left
13661366
"""
13671367
Event.__init__(self, name, canvas, guiEvent=guiEvent)
1368-
self.x = x # x position - pixels from left of canvas
1369-
self.y = y # y position - pixels from right of canvas
1368+
self.x = int(x) # x position - pixels from left of canvas
1369+
self.y = int(y) # y position - pixels from right of canvas
13701370
self.inaxes = None # the Axes instance if mouse us over axes
13711371
self.xdata = None # x coord of mouse in data coords
13721372
self.ydata = None # y coord of mouse in data coords

0 commit comments

Comments
 (0)