From 9df4df55c49ace05020e6b7c52128fdce09e2a8d Mon Sep 17 00:00:00 2001 From: Luke Campagnola Date: Sat, 4 Apr 2015 11:20:11 -0400 Subject: [PATCH] Bugfix: don't create extra AxisItem when user provides them Committed old changelog updates --- CHANGELOG | 8 ++++++-- pyqtgraph/graphicsItems/PlotItem/PlotItem.py | 5 ++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index a1da542e..467f19c1 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -3,12 +3,16 @@ pyqtgraph-0.9.11 [unreleased] Bugfixes: - Fixed git version string generation on python3 - Fixed setting default values for out-of-bound points in pg.interpolateArray - - Fixed adding Docks to DockArea after all Docks have been removed - Fixed plot downsampling bug on python 3 + - DockArea: + - Fixed adding Docks to DockArea after all Docks have been removed + - Fixed DockArea save/restoreState when area is empty New Features: - Preliminary PyQt5 support - - Dock titles can be changed + - DockArea: + - Dock titles can be changed after creation + - Added Dock.sigClosed pyqtgraph-0.9.10 diff --git a/pyqtgraph/graphicsItems/PlotItem/PlotItem.py b/pyqtgraph/graphicsItems/PlotItem/PlotItem.py index 2cfb803d..6e9c8240 100644 --- a/pyqtgraph/graphicsItems/PlotItem/PlotItem.py +++ b/pyqtgraph/graphicsItems/PlotItem/PlotItem.py @@ -170,7 +170,10 @@ class PlotItem(GraphicsWidget): axisItems = {} self.axes = {} for k, pos in (('top', (1,1)), ('bottom', (3,1)), ('left', (2,0)), ('right', (2,2))): - axis = axisItems.get(k, AxisItem(orientation=k, parent=self)) + if k in axisItems: + axis = axisItems[k] + else: + axis = AxisItem(orientation=k, parent=self) axis.linkToView(self.vb) self.axes[k] = {'item': axis, 'pos': pos} self.layout.addItem(axis, *pos)