<h3 dir="auto">Bug report</h3>
<p dir="auto">In tag 2.0.1 the NavigationToolbar2QT includes an unchecked call to a Qt5 feature:</p>
<p dir="auto"><code class="notranslate">pm.setDevicePixelRatio(self.canvas._dpi_ratio)</code></p>
<p dir="auto"><a href="https://github.com/matplotlib/matplotlib/blob/v2.0.1/lib/matplotlib/backends/backend_qt5.py#L587-L592">https://github.com/matplotlib/matplotlib/blob/v2.0.1/lib/matplotlib/backends/backend_qt5.py#L587-L592</a></p>
<p dir="auto">This is strange, b/c it's not there in tag 2.0.0 <em>and</em> it's not there in master!</p>
<p dir="auto">I can reproduce this with a simple <code class="notranslate">plt.plot(np.random.randn(10))</code>.</p>
<p dir="auto"><code class="notranslate">AttributeError: 'PySide.QtGui.QPixmap' object has no attribute 'setDevicePixelRatio'</code></p>
<p dir="auto">Issue goes away when I revert to 2.0.0</p>
<h3 dir="auto">Bug report</h3>
<p dir="auto"><strong>Bug summary</strong><br>
Running arbitrary tests with matplotlib-2.0.1 results in<br>
AttributeError: 'QPixmap' object has no attribute 'setDevicePixelRatio'</p>
<p dir="auto">matplotlib-2.0.0 works fine</p>

<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="Arbitrary test, f.i.
python histogram_demo_cumulative.py

**Actual outcome**

&lt;!--The output produced by the above code, which may be a screenshot, console output, etc.--&gt;
"><pre class="notranslate"><span class="pl-v">Arbitrary</span> <span class="pl-s1">test</span>, <span class="pl-s1">f</span>.<span class="pl-s1">i</span>.
<span class="pl-s1">python</span> <span class="pl-s1">histogram_demo_cumulative</span>.<span class="pl-s1">py</span>

<span class="pl-c1">**</span><span class="pl-v">Actual</span> <span class="pl-s1">outcome</span><span class="pl-c1">**</span>

<span class="pl-c1">&lt;</span>!<span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-v">The</span> <span class="pl-s1">output</span> <span class="pl-s1">produced</span> <span class="pl-s1">by</span> <span class="pl-s1">the</span> <span class="pl-s1">above</span> <span class="pl-s1">code</span>, <span class="pl-s1">which</span> <span class="pl-s1">may</span> <span class="pl-s1">be</span> <span class="pl-s1">a</span> <span class="pl-s1">screenshot</span>, <span class="pl-s1">console</span> <span class="pl-s1">output</span>, <span class="pl-s1">etc</span>.<span class="pl-c1">-</span><span class="pl-c1">-&gt;</span></pre></div>
<h1 dir="auto">If applicable, paste the console output here</h1>
<p dir="auto">`Traceback (most recent call last):<br>
File "histogram_demo_cumulative.py", line 16, in <br>
histtype='step', cumulative=True)<br>
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<br>
ax = gca()<br>
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<br>
return gcf().gca(**kwargs)<br>
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<br>
return figure()<br>
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<br>
**kwargs)<br>
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<br>
return new_figure_manager_given_figure(num, thisFig)<br>
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<br>
return FigureManagerQT(canvas, num)<br>
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 <strong>init</strong><br>
self.toolbar = self._get_toolbar(self.canvas, self.window)<br>
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<br>
toolbar = NavigationToolbar2QT(canvas, parent, False)<br>
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 <strong>init</strong><br>
NavigationToolbar2.<strong>init</strong>(self, canvas)<br>
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 <strong>init</strong><br>
self._init_toolbar()<br>
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<br>
a = self.addAction(self._icon(image_file + '.png'),<br>
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<br>
pm.setDevicePixelRatio(self.canvas._dpi_ratio)<br>
AttributeError: 'QPixmap' object has no attribute 'setDevicePixelRatio'</p>
<p dir="auto"><strong>Expected outcome</strong></p>


<p dir="auto"><strong>Matplotlib version</strong></p>

<ul dir="auto">
<li>Operating System: Linux</li>
<li>Matplotlib Version: 2.0.1</li>
<li>Python Version: 2.7.13</li>
<li>Jupyter Version (if applicable):</li>
<li>Other Libraries:</li>
</ul>

<p dir="auto">Installed from source</p>