diff --git a/pyqtgraph/graphicsItems/ViewBox/ViewBox.py b/pyqtgraph/graphicsItems/ViewBox/ViewBox.py index f0ea1e57..419b6306 100644 --- a/pyqtgraph/graphicsItems/ViewBox/ViewBox.py +++ b/pyqtgraph/graphicsItems/ViewBox/ViewBox.py @@ -608,11 +608,10 @@ class ViewBox(GraphicsWidget): self.setRange(vr.translated(t), padding=0) else: if x is not None: - x1, x2 = vr.left()+x, vr.right()+x - self.setXRange(x1, x2, padding=0) + x = vr.left()+x, vr.right()+x if y is not None: - y1, y2 = vr.top()+y, vr.bottom()+y - self.setYRange(y1, y2, padding=0) + y = vr.top()+y, vr.bottom()+y + self.setRange(xRange=x, yRange=y, padding=0)