Skip to content

Qt backend figureoptions.py does not work due to change in image.py #9332

Closed

Description

@bastianbeischer

Bug report

Bug summary

Clicking on the figure options button (only available in the Qt backend) when showing an image does not work anymore. The dialog does not open and the script throws a TypeError.

Code for reproduction

from matplotlib import use
use('Qt5Agg')

import numpy as np
import matplotlib.pyplot as plt

data = np.ones((10,10))

plt.figure()
plt.imshow(data)
plt.show()

Click on figure options button (the second one from the right).

Actual outcome

Figure options dialog is not shown, instead a TypeError is thrown:

Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/matplotlib/backends/backend_qt5.py", line 681, in edit_parameters
    figureoptions.figure_edit(axes, self)
  File "/usr/lib/python2.7/site-packages/matplotlib/backends/qt_editor/figureoptions.py", line 168, in figure_edit
    + [(name, name) for name in sorted(image.iterpnames)])]
TypeError: 'instancemethod' object is not iterable

Expected outcome

Figure options dialog is opened and the script does not throw the TypeError. Used to work in matplot 2.0.2.

Matplotlib version

Bug introduced in matplotlib 2.1.0, specifcally this commit:

6ee70cb

changes 'iterpnames' from a variable (which is iterable) into a function (which must be called). The callside (figureoptions.py) was not modified accordingly. I guess adding '()' after iterpnames in figureoptions.py line 168 fixes the problem (untested).

Activity

  1. added
    Release criticalFor bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions.
    on Oct 9, 2017
  2. added this to the milestone on Oct 9, 2017
  3. anntzer commented on Oct 9, 2017

    @anntzer
    Contributor

    Sorry... xref #9335.

  4. tacaswell commented on Oct 21, 2017

    @tacaswell
    Member

    Closed by #9335

    Thanks for taking the time to report this @bastianbeischer !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    GUI: QtRelease criticalFor bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions.

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions