Skip to content

Unexpected mixing of qt4backend and qt5backend #8565

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Kadelka opened this issue May 3, 2017 · 1 comment
Closed

Unexpected mixing of qt4backend and qt5backend #8565

Kadelka opened this issue May 3, 2017 · 1 comment

Comments

@Kadelka
Copy link

Kadelka commented May 3, 2017

Bug report

Bug summary
Running arbitrary tests with matplotlib-2.0.1 results in
AttributeError: 'QPixmap' object has no attribute 'setDevicePixelRatio'

matplotlib-2.0.0 works fine

Arbitrary test, f.i.
python histogram_demo_cumulative.py

**Actual outcome**

<!--The output produced by the above code, which may be a screenshot, console output, etc.-->

If applicable, paste the console output here

`Traceback (most recent call last):
File "histogram_demo_cumulative.py", line 16, in
histtype='step', cumulative=True)
File "/usr/local/lib/python2.7/site-packages/matplotlib-2.0.1-py2.7-linux-x86_64.egg/matplotlib/pyplot.py", line 3066, in hist
ax = gca()
File "/usr/local/lib/python2.7/site-packages/matplotlib-2.0.1-py2.7-linux-x86_64.egg/matplotlib/pyplot.py", line 950, in gca
return gcf().gca(**kwargs)
File "/usr/local/lib/python2.7/site-packages/matplotlib-2.0.1-py2.7-linux-x86_64.egg/matplotlib/pyplot.py", line 586, in gcf
return figure()
File "/usr/local/lib/python2.7/site-packages/matplotlib-2.0.1-py2.7-linux-x86_64.egg/matplotlib/pyplot.py", line 535, in figure
**kwargs)
File "/usr/local/lib/python2.7/site-packages/matplotlib-2.0.1-py2.7-linux-x86_64.egg/matplotlib/backends/backend_qt4agg.py", line 46, in new_figure_manager
return new_figure_manager_given_figure(num, thisFig)
File "/usr/local/lib/python2.7/site-packages/matplotlib-2.0.1-py2.7-linux-x86_64.egg/matplotlib/backends/backend_qt4agg.py", line 54, in new_figure_manager_given_figure
return FigureManagerQT(canvas, num)
File "/usr/local/lib/python2.7/site-packages/matplotlib-2.0.1-py2.7-linux-x86_64.egg/matplotlib/backends/backend_qt5.py", line 488, in init
self.toolbar = self._get_toolbar(self.canvas, self.window)
File "/usr/local/lib/python2.7/site-packages/matplotlib-2.0.1-py2.7-linux-x86_64.egg/matplotlib/backends/backend_qt5.py", line 539, in _get_toolbar
toolbar = NavigationToolbar2QT(canvas, parent, False)
File "/usr/local/lib/python2.7/site-packages/matplotlib-2.0.1-py2.7-linux-x86_64.egg/matplotlib/backends/backend_qt5.py", line 585, in init
NavigationToolbar2.init(self, canvas)
File "/usr/local/lib/python2.7/site-packages/matplotlib-2.0.1-py2.7-linux-x86_64.egg/matplotlib/backend_bases.py", line 2760, in init
self._init_toolbar()
File "/usr/local/lib/python2.7/site-packages/matplotlib-2.0.1-py2.7-linux-x86_64.egg/matplotlib/backends/backend_qt5.py", line 601, in _init_toolbar
a = self.addAction(self._icon(image_file + '.png'),
File "/usr/local/lib/python2.7/site-packages/matplotlib-2.0.1-py2.7-linux-x86_64.egg/matplotlib/backends/backend_qt5.py", line 591, in _icon
pm.setDevicePixelRatio(self.canvas._dpi_ratio)
AttributeError: 'QPixmap' object has no attribute 'setDevicePixelRatio'

Expected outcome

Matplotlib version

  • Operating System: Linux
  • Matplotlib Version: 2.0.1
  • Python Version: 2.7.13
  • Jupyter Version (if applicable):
  • Other Libraries:

Installed from source

@efiring
Copy link
Member

efiring commented May 3, 2017

This has been fixed, and 2.0.2 will be released with the fix within a few days.

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

No branches or pull requests

3 participants