Closed
Description
Bug report
Bug summary
pyplot.plot worked fine (including version 2.0.0) with the Qt4/PySide backend specified in matplotlibrc. With version 2.0.1, it seems to try to use Qt5 instead and fails.
Code for reproduction
Any code
import matplotlib.pyplot as plt
plt.plot([1, 2, 3])
plt.show()
Actual outcome
c:\python34\lib\site-packages\matplotlib\pyplot.py in plot(*args, **kwargs)
3304 @_autogen_docstring(Axes.plot)
3305 def plot(*args, **kwargs):
-> 3306 ax = gca()
3307 # Deprecated: allow callers to override the hold state
3308 # by passing hold=True|False
c:\python34\lib\site-packages\matplotlib\pyplot.py in gca(**kwargs)
948 matplotlib.figure.Figure.gca : The figure's gca method.
949 """
--> 950 return gcf().gca(**kwargs)
951
952 # More ways of creating axes:
c:\python34\lib\site-packages\matplotlib\pyplot.py in gcf()
584 return figManager.canvas.figure
585 else:
--> 586 return figure()
587
588
c:\python34\lib\site-packages\matplotlib\pyplot.py in figure(num, figsize, dpi, facecolor, edgecolor, frameon, FigureClass, **kwargs)
533 frameon=frameon,
534 FigureClass=FigureClass,
--> 535 **kwargs)
536
537 if figLabel:
c:\python34\lib\site-packages\matplotlib\backends\backend_qt4agg.py in new_figure_manager(num, *args, **kwargs)
44 FigureClass = kwargs.pop('FigureClass', Figure)
45 thisFig = FigureClass(*args, **kwargs)
---> 46 return new_figure_manager_given_figure(num, thisFig)
47
48
c:\python34\lib\site-packages\matplotlib\backends\backend_qt4agg.py in new_figure_manager_given_figure(num, figure)
52 """
53 canvas = FigureCanvasQTAgg(figure)
---> 54 return FigureManagerQT(canvas, num)
55
56
c:\python34\lib\site-packages\matplotlib\backends\backend_qt5.py in __init__(self, canvas, num)
486 self.window.statusBar().addWidget(self.statusbar_label)
487
--> 488 self.toolbar = self._get_toolbar(self.canvas, self.window)
489 if self.toolbar is not None:
490 self.window.addToolBar(self.toolbar)
c:\python34\lib\site-packages\matplotlib\backends\backend_qt5.py in _get_toolbar(self, canvas, parent)
537 # attrs are set
538 if matplotlib.rcParams['toolbar'] == 'toolbar2':
--> 539 toolbar = NavigationToolbar2QT(canvas, parent, False)
540 else:
541 toolbar = None
c:\python34\lib\site-packages\matplotlib\backends\backend_qt5.py in __init__(self, canvas, parent, coordinates)
583
584 QtWidgets.QToolBar.__init__(self, parent)
--> 585 NavigationToolbar2.__init__(self, canvas)
586
587 def _icon(self, name):
c:\python34\lib\site-packages\matplotlib\backend_bases.py in __init__(self, canvas)
2758 self._active = None
2759 self._lastCursor = None
-> 2760 self._init_toolbar()
2761 self._idDrag = self.canvas.mpl_connect(
2762 'motion_notify_event', self.mouse_move)
c:\python34\lib\site-packages\matplotlib\backends\backend_qt5.py in _init_toolbar(self)
599 self.addSeparator()
600 else:
--> 601 a = self.addAction(self._icon(image_file + '.png'),
602 text, getattr(self, callback))
603 self._actions[callback] = a
c:\python34\lib\site-packages\matplotlib\backends\backend_qt5.py in _icon(self,name)
589 name = name.replace('.png', '_large.png')
590 pm = QtGui.QPixmap(os.path.join(self.basedir, name))
--> 591 pm.setDevicePixelRatio(self.canvas._dpi_ratio)
592 return QtGui.QIcon(pm)
593
AttributeError: 'PySide.QtGui.QPixmap' object has no attribute 'setDevicePixelRatio'
Expected outcome
Show the plot.
Matplotlib version
- Operating System: Windows 7
- Matplotlib Version: 2.0.1
- Python Version: 3.4.3
- Jupyter Version (if applicable): -
- Other Libraries: PySide 1.2.4
Installed via pip