From a5dd549be1e120adce676d0f327b36db4e6777df Mon Sep 17 00:00:00 2001 From: lcmcninch Date: Fri, 3 Apr 2020 18:33:21 -0400 Subject: [PATCH] Pass showAxRect keyword arguments to setRange to allow caller to set padding, etc. (#1145) Co-authored-by: Luke McNinch --- pyqtgraph/graphicsItems/ViewBox/ViewBox.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pyqtgraph/graphicsItems/ViewBox/ViewBox.py b/pyqtgraph/graphicsItems/ViewBox/ViewBox.py index e504be56..bf2bb5b5 100644 --- a/pyqtgraph/graphicsItems/ViewBox/ViewBox.py +++ b/pyqtgraph/graphicsItems/ViewBox/ViewBox.py @@ -1303,8 +1303,11 @@ class ViewBox(GraphicsWidget): self.rbScaleBox.scale(r.width(), r.height()) self.rbScaleBox.show() - def showAxRect(self, ax): - self.setRange(ax.normalized()) # be sure w, h are correct coordinates + def showAxRect(self, ax, **kwargs): + """Set the visible range to the given rectangle + Passes keyword arguments to setRange + """ + self.setRange(ax.normalized(), **kwargs) # be sure w, h are correct coordinates self.sigRangeChangedManually.emit(self.state['mouseEnabled']) def allChildren(self, item=None):