From: <ds...@us...> - 2007-08-14 14:14:23
|
Revision: 3709 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=3709&view=rev Author: dsdale Date: 2007-08-14 07:13:27 -0700 (Tue, 14 Aug 2007) Log Message: ----------- fixed a bug in pyqt4 subplots-adjust Modified Paths: -------------- trunk/matplotlib/CHANGELOG trunk/matplotlib/lib/matplotlib/__init__.py trunk/matplotlib/lib/matplotlib/backends/backend_qt4.py Modified: trunk/matplotlib/CHANGELOG =================================================================== --- trunk/matplotlib/CHANGELOG 2007-08-14 13:22:56 UTC (rev 3708) +++ trunk/matplotlib/CHANGELOG 2007-08-14 14:13:27 UTC (rev 3709) @@ -1,3 +1,6 @@ +2007-08-14 Fixed a bug in pyqt4 subplots-adjust. Thanks to + Xavier Gnata for the report and suggested fix - DSD + 2007-08-13 Use pickle to cache entire fontManager; change to using font_manager module-level function findfont wrapper for the fontManager.findfont method - EF Modified: trunk/matplotlib/lib/matplotlib/__init__.py =================================================================== --- trunk/matplotlib/lib/matplotlib/__init__.py 2007-08-14 13:22:56 UTC (rev 3708) +++ trunk/matplotlib/lib/matplotlib/__init__.py 2007-08-14 14:13:27 UTC (rev 3709) @@ -709,11 +709,10 @@ if NEWCONFIG: #print "importing from reorganized config system!" - from config import rcParams, rcdefaults try: - from config import mplConfig, save_config + from config import rcParams, rcdefaults, mplConfig, save_config except: - pass + from config import rcParams, rcdefaults def use(arg): """ Modified: trunk/matplotlib/lib/matplotlib/backends/backend_qt4.py =================================================================== --- trunk/matplotlib/lib/matplotlib/backends/backend_qt4.py 2007-08-14 13:22:56 UTC (rev 3708) +++ trunk/matplotlib/lib/matplotlib/backends/backend_qt4.py 2007-08-14 14:13:27 UTC (rev 3709) @@ -405,13 +405,17 @@ self.sliderhspace = QtGui.QSlider(QtCore.Qt.Vertical) # constraints - QtCore.QObject.connect( self.sliderleft, QtCore.SIGNAL( "valueChanged(int)" ), + QtCore.QObject.connect( self.sliderleft, + QtCore.SIGNAL( "valueChanged(int)" ), self.sliderright.setMinimum ) - QtCore.QObject.connect( self.sliderright, QtCore.SIGNAL( "valueChanged(int)" ), + QtCore.QObject.connect( self.sliderright, + QtCore.SIGNAL( "valueChanged(int)" ), self.sliderleft.setMaximum ) - QtCore.QObject.connect( self.sliderbottom, QtCore.SIGNAL( "valueChanged(int)" ), + QtCore.QObject.connect( self.sliderbottom, + QtCore.SIGNAL( "valueChanged(int)" ), self.slidertop.setMinimum ) - QtCore.QObject.connect( self.slidertop, QtCore.SIGNAL( "valueChanged(int)" ), + QtCore.QObject.connect( self.slidertop, + QtCore.SIGNAL( "valueChanged(int)" ), self.sliderbottom.setMaximum ) sliders = (self.sliderleft, self.sliderbottom, self.sliderright, @@ -464,38 +468,56 @@ self.setLayout(layout) self.sliderleft.setSliderPosition(int(targetfig.subplotpars.left*1000)) - self.sliderbottom.setSliderPosition(int(targetfig.subplotpars.bottom*1000)) - self.sliderright.setSliderPosition(int(targetfig.subplotpars.right*1000)) + self.sliderbottom.setSliderPosition(\ + int(targetfig.subplotpars.bottom*1000)) + self.sliderright.setSliderPosition(\ + int(targetfig.subplotpars.right*1000)) self.slidertop.setSliderPosition(int(targetfig.subplotpars.top*1000)) - self.sliderwspace.setSliderPosition(int(targetfig.subplotpars.wspace*1000)) - self.sliderhspace.setSliderPosition(int(targetfig.subplotpars.hspace*1000)) + self.sliderwspace.setSliderPosition(\ + int(targetfig.subplotpars.wspace*1000)) + self.sliderhspace.setSliderPosition(\ + int(targetfig.subplotpars.hspace*1000)) - QtCore.QObject.connect( self.sliderleft, QtCore.SIGNAL( "valueChanged(int)" ), + QtCore.QObject.connect( self.sliderleft, + QtCore.SIGNAL( "valueChanged(int)" ), self.funcleft ) - QtCore.QObject.connect( self.sliderbottom, QtCore.SIGNAL( "valueChanged(int)" ), + QtCore.QObject.connect( self.sliderbottom, + QtCore.SIGNAL( "valueChanged(int)" ), self.funcbottom ) - QtCore.QObject.connect( self.sliderright, QtCore.SIGNAL( "valueChanged(int)" ), + QtCore.QObject.connect( self.sliderright, + QtCore.SIGNAL( "valueChanged(int)" ), self.funcright ) - QtCore.QObject.connect( self.slidertop, QtCore.SIGNAL( "valueChanged(int)" ), + QtCore.QObject.connect( self.slidertop, + QtCore.SIGNAL( "valueChanged(int)" ), self.functop ) - QtCore.QObject.connect( self.sliderwspace, QtCore.SIGNAL( "valueChanged(int)" ), + QtCore.QObject.connect( self.sliderwspace, + QtCore.SIGNAL( "valueChanged(int)" ), self.funcwspace ) - QtCore.QObject.connect( self.sliderhspace, QtCore.SIGNAL( "valueChanged(int)" ), + QtCore.QObject.connect( self.sliderhspace, + QtCore.SIGNAL( "valueChanged(int)" ), self.funchspace ) def funcleft(self, val): + if val == self.sliderright.value(): + val -= 1 self.targetfig.subplots_adjust(left=val/1000.) if self.drawon: self.targetfig.canvas.draw() def funcright(self, val): + if val == self.sliderleft.value(): + val += 1 self.targetfig.subplots_adjust(right=val/1000.) if self.drawon: self.targetfig.canvas.draw() def funcbottom(self, val): + if val == self.slidertop.value(): + val -= 1 self.targetfig.subplots_adjust(bottom=val/1000.) if self.drawon: self.targetfig.canvas.draw() def functop(self, val): + if val == self.sliderbottom.value(): + val += 1 self.targetfig.subplots_adjust(top=val/1000.) if self.drawon: self.targetfig.canvas.draw() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |