Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion lib/matplotlib/backends/backend_wx.py
Original file line number Diff line number Diff line change
Expand Up @@ -618,7 +618,8 @@ def gui_repaint(self, drawDC=None, origin='WX'):
else self.bitmap)
drawDC.DrawBitmap(bmp, 0, 0)
if self._rubberband_rect is not None:
x0, y0, x1, y1 = self._rubberband_rect
# Some versions of wx+python don't support numpy.float64 here.
x0, y0, x1, y1 = map(int, self._rubberband_rect)
drawDC.DrawLineList(
[(x0, y0, x1, y0), (x1, y0, x1, y1),
(x0, y0, x0, y1), (x0, y1, x1, y1)],
Expand Down
2 changes: 2 additions & 0 deletions lib/matplotlib/tests/test_backends_interactive.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,8 @@ def check_alt_backend(alt_backend):
"matplotlib.backends.backend_{}".format(backend))

ax.plot([0, 1], [2, 3])
if fig.canvas.toolbar: # i.e toolbar2.
fig.canvas.toolbar.draw_rubberband(None, 1., 1, 2., 2)

timer = fig.canvas.new_timer(1.) # Test floats casting to int as needed.
timer.add_callback(FigureCanvasBase.key_press_event, fig.canvas, "q")
Expand Down