From d09d19b94a80827e83cb3bcde5b0beffa0e9cc36 Mon Sep 17 00:00:00 2001 From: Jorge Moraleda Date: Sun, 21 Sep 2025 16:55:00 -0400 Subject: [PATCH] Add ScrollLeft and ScrollDown to PlotCanvas to complement already-extant ScrollRight and ScrollUp --- wx/lib/plot/plotcanvas.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/wx/lib/plot/plotcanvas.py b/wx/lib/plot/plotcanvas.py index b9f65d8d..145023af 100644 --- a/wx/lib/plot/plotcanvas.py +++ b/wx/lib/plot/plotcanvas.py @@ -1456,6 +1456,10 @@ class PlotCanvas(wx.Panel): xAxis = (xAxis[0] + units, xAxis[1] + units) self._Draw(graphics, xAxis, yAxis) + def ScrollLeft(self, units): + """Move view left number of axis units.""" + self.ScrollRight(-units) + def ScrollUp(self, units): """Move view up number of axis units.""" self.last_PointLabel = None # reset pointLabel @@ -1463,6 +1467,10 @@ class PlotCanvas(wx.Panel): graphics, xAxis, yAxis = self.last_draw yAxis = (yAxis[0] + units, yAxis[1] + units) self._Draw(graphics, xAxis, yAxis) + + def ScrollDown(self, units): + """Move view down number of axis units.""" + self.ScrollUp(-units) def GetXY(self, event): """Wrapper around _getXY, which handles log scales"""