Merge pull request #935 from 2xB/addLine-fix70

PlotItem.addLine now accepts 'pos' and 'angle' parameters
This commit is contained in:
Ogi Moore 2019-06-20 09:18:57 -07:00 committed by GitHub
commit 132f417f72
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -545,9 +545,9 @@ class PlotItem(GraphicsWidget):
:func:`InfiniteLine.__init__() <pyqtgraph.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)