diff --git a/lib/matplotlib/backends/web_backend/js/mpl.js b/lib/matplotlib/backends/web_backend/js/mpl.js index 6a81610a2ba7..7c774b4a16d0 100644 --- a/lib/matplotlib/backends/web_backend/js/mpl.js +++ b/lib/matplotlib/backends/web_backend/js/mpl.js @@ -346,7 +346,7 @@ mpl.figure.prototype.handle_rubberband = function(fig, msg) { var height = Math.abs(y1 - y0); fig.rubberband_context.clearRect( - 0, 0, fig.canvas.width, fig.canvas.height); + 0, 0, fig.canvas.width / mpl.ratio, fig.canvas.height / mpl.ratio); fig.rubberband_context.strokeRect(min_x, min_y, width, height); }