From 04baa6eef7571ef1565674bb226603b87725763b Mon Sep 17 00:00:00 2001 From: 2xB <31772910+2xB@users.noreply.github.com> Date: Thu, 20 Jun 2019 04:37:09 +0200 Subject: [PATCH] addLine now accepts 'pos' and 'angle' parameters The issue and this solution are discussed in issue https://github.com/pyqtgraph/pyqtgraph/issues/70. --- pyqtgraph/graphicsItems/PlotItem/PlotItem.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pyqtgraph/graphicsItems/PlotItem/PlotItem.py b/pyqtgraph/graphicsItems/PlotItem/PlotItem.py index ae74c5b6..9703f286 100644 --- a/pyqtgraph/graphicsItems/PlotItem/PlotItem.py +++ b/pyqtgraph/graphicsItems/PlotItem/PlotItem.py @@ -545,9 +545,9 @@ class PlotItem(GraphicsWidget): :func:`InfiniteLine.__init__() `. Returns the item created. """ - pos = kwds.get('pos', x if x is not None else y) - angle = kwds.get('angle', 0 if x is None else 90) - line = InfiniteLine(pos, angle, **kwds) + kwds['pos'] = kwds.get('pos', x if x is not None else y) + kwds['angle'] = kwds.get('angle', 0 if x is None else 90) + line = InfiniteLine(**kwds) self.addItem(line) if z is not None: line.setZValue(z)