From b8abd5d02e7a7dca95e3c19c58acc3746000fd81 Mon Sep 17 00:00:00 2001 From: Ogi Moore Date: Tue, 23 Jun 2020 22:22:51 -0700 Subject: [PATCH] Don't let axis item reduce space --- pyqtgraph/graphicsItems/AxisItem.py | 4 ++-- pyqtgraph/graphicsItems/tests/test_ErrorBarItem.py | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pyqtgraph/graphicsItems/AxisItem.py b/pyqtgraph/graphicsItems/AxisItem.py index 3916e8dc..05ce3f94 100644 --- a/pyqtgraph/graphicsItems/AxisItem.py +++ b/pyqtgraph/graphicsItems/AxisItem.py @@ -359,7 +359,7 @@ class AxisItem(GraphicsWidget): if self.fixedHeight is None: if not self.style['showValues']: h = 0 - elif self.style['autoExpandTextSpace'] is True: + elif self.style['autoExpandTextSpace']: h = self.textHeight else: h = self.style['tickTextHeight'] @@ -390,7 +390,7 @@ class AxisItem(GraphicsWidget): if self.fixedWidth is None: if not self.style['showValues']: w = 0 - elif self.style['autoExpandTextSpace'] is True: + elif self.style['autoExpandTextSpace']: w = self.textWidth else: w = self.style['tickTextWidth'] diff --git a/pyqtgraph/graphicsItems/tests/test_ErrorBarItem.py b/pyqtgraph/graphicsItems/tests/test_ErrorBarItem.py index 2b922c1e..f28c681a 100644 --- a/pyqtgraph/graphicsItems/tests/test_ErrorBarItem.py +++ b/pyqtgraph/graphicsItems/tests/test_ErrorBarItem.py @@ -21,19 +21,19 @@ def test_ErrorBarItem_defer_data(): app.processEvents() r_empty_ebi = plot.viewRect() - assert r_no_ebi == r_empty_ebi + assert r_no_ebi.height() == r_empty_ebi.height() err.setData(x=x, y=x, bottom=x, top=x) app.processEvents() r_ebi = plot.viewRect() - assert r_empty_ebi != r_ebi + assert r_ebi.height() > r_empty_ebi.height() # unset data, ErrorBarItem disappears and view rect goes back to original err.setData(x=None, y=None) app.processEvents() r_clear_ebi = plot.viewRect() - assert r_clear_ebi == r_no_ebi + assert r_clear_ebi.height() == r_empty_ebi.height() plot.close()