From 654b76e6a360dd62c21082be8820c2020a90c049 Mon Sep 17 00:00:00 2001 From: Kenneth Lyons Date: Thu, 6 Jun 2019 23:57:34 -0700 Subject: [PATCH] Handle setting/clearing data a little more robustly. --- pyqtgraph/graphicsItems/ErrorBarItem.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pyqtgraph/graphicsItems/ErrorBarItem.py b/pyqtgraph/graphicsItems/ErrorBarItem.py index 4dc93a56..5e399e34 100644 --- a/pyqtgraph/graphicsItems/ErrorBarItem.py +++ b/pyqtgraph/graphicsItems/ErrorBarItem.py @@ -45,9 +45,11 @@ class ErrorBarItem(GraphicsObject): This method was added in version 0.9.9. For prior versions, use setOpts. """ - if 'x' in opts and 'y' in opts: - self.setVisible(True) self.opts.update(opts) + if self.opts['x'] is not None and self.opts['y'] is not None: + self.setVisible(True) + else: + self.setVisible(False) self.path = None self.update() self.prepareGeometryChange()