On Mon, May 3, 2010 at 4:02 PM, Darren Dale <dsdal...@gmail.com> wrote:
> On Sun, Apr 18, 2010 at 12:55 PM, Gökhan Sever <gokhanse...@gmail.com> wrote:
>>
>>
>> On Sun, Apr 18, 2010 at 11:47 AM, Darren Dale <dsdal...@gmail.com> wrote:
>>>
>>> On Tue, Apr 13, 2010 at 8:14 PM, Gökhan Sever <gokhanse...@gmail.com>
>>> wrote:
>>> > Hello,
>>> >
>>> > Could someone confirm me if there is any malfunctioning using these
>>> > simple
>>> > figure functions?
>>> >
>>> > plt.figure(figsize=(2,3))
>>> >
>>> > plt.figure(figsize=(5,6))
>>> >
>>> > plt.figure(figsize=(9,15))
>>> >
>>> > plt.figure(figsize=(19,5))
>>> >
>>> > For some reason I can't get Qt4Agg creating last two figures in
>>> > specified
>>> > sizes. (WXAgg works fine.)
>>> >
>>> > matplotlib.__version__
>>> > '1.0.svn'
>>> >
>>> > matplotlib.__revision__
>>> > '$Revision: 8226 $'
>>> >
>>> > from PyQt4 import QtCore
>>> > QtCore.PYQT_VERSION_STR
>>> > '4.7'
>>>
>>> I can reproduce this behavior with a pure pyqt4 example with no mpl
>>> code, see below. I asked for advice on the pyqt mailing list.
>>>
>>> import sys
>>> from PyQt4 import QtCore, QtGui
>>>
>>> class Test(QtGui.QWidget):
>>>
>>>   def __init__(self, width, height):
>>>       QtGui.QWidget.__init__(self)
>>>       #self.setSizePolicy(QtGui.QSizePolicy.Fixed,
>>> QtGui.QSizePolicy.Fixed)
>>>       print 'Central widget should have width=%d, height=%d' %(width,
>>> height)
>>>       self._width = width
>>>       self._height = height
>>>
>>>   def sizeHint(self):
>>>       return QtCore.QSize(self._width, self._height)
>>>
>>> app = QtGui.QApplication([])
>>> m = QtGui.QMainWindow()
>>> c = Test(1000, 700)
>>> m.setCentralWidget(c)
>>> m.show()
>>> s = c.size()
>>> print 'but central widget has width=%d, height=%d'% (s.width(),
>>> s.height())
>>> sys.exit(app.exec_())
>>
>> Same here with your sample:
>>
>> Central widget should have width=1000, height=700
>> but central widget has width=960, height=600
>>
>> I resorted to WXAgg for the time being. Waiting for some updates till I hear
>> a resolution. The annoying part is when I created a plot using specified
>> width and height Qt4Agg doesn't follow these dimensions as in this case and
>> resulting savefig(file.pdf) produces wrongly sized file unless I manually
>> extend the figure area and re-issue a savefig afterwards.
>
> I got a suggestion at the PyQt4 mailing list, and the following patch
> appears to resolve the problem. However, before I commit the change,
> I'd like to hear from John or Andrew: What is the protocol for dealing
> with a change that may affect unit tests?


This shouldn't affects tests I don't think because it is a change to a
GUI backend and we are only doing unit tests on hardcopy images at
this point.

In general, run matplotlib.test


  > python -c 'import matplotlib; matplotlib.test()'


and look to see if any tests are failing. If any are, either fix the
problem or if you decide the baseline image is broken update that in
lib/matplotlib/tests/baseline_images.  There is more in
doc/devel/coding_guide.rst under "Testing".  Andrew may have more to
add...

JDH

------------------------------------------------------------------------------
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to