From 2393965e833886cb4ea5f125db593ef775bb6b50 Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Thu, 21 Jul 2022 11:37:18 -0400 Subject: [PATCH] Fix bottom axis when no fsps/subplots --- piker/ui/_chart.py | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/piker/ui/_chart.py b/piker/ui/_chart.py index 688b97eb..3231698b 100644 --- a/piker/ui/_chart.py +++ b/piker/ui/_chart.py @@ -453,13 +453,6 @@ class LinkedSplits(QWidget): # add crosshair graphic self.chart.addItem(self.cursor) - # axis placement - if ( - _xaxis_at == 'bottom' and - 'bottom' in self.chart.plotItem.axes - ): - self.chart.hideAxis('bottom') - # style? self.chart.setFrameStyle( QFrame.StyledPanel | @@ -524,21 +517,26 @@ class LinkedSplits(QWidget): cpw.hideAxis('left') cpw.hideAxis('bottom') - if self.xaxis_chart: - self.xaxis_chart.hideAxis('bottom') + if ( + _xaxis_at == 'bottom' and ( + self.xaxis_chart + or ( + not self.subplots + and self.xaxis_chart is None + ) + ) + ): + if self.xaxis_chart: + self.xaxis_chart.hideAxis('bottom') # presuming we only want it at the true bottom of all charts. # XXX: uses new api from our ``pyqtgraph`` fork. # https://github.com/pikers/pyqtgraph/tree/plotitemoverlay_onto_pg_master # _ = self.xaxis_chart.removeAxis('bottom', unlink=False) # assert 'bottom' not in self.xaxis_chart.plotItem.axes - self.xaxis_chart = cpw cpw.showAxis('bottom') - if self.xaxis_chart is None: - self.xaxis_chart = cpw - qframe.chart = cpw qframe.hbox.addWidget(cpw)