Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 59380fa commit 4d4b653Copy full SHA for 4d4b653
1 file changed
lib/matplotlib/backends/backend_qt5.py
@@ -269,11 +269,7 @@ def _update_figure_dpi(self):
269
def _dpi_ratio(self):
270
# Not available on Qt4 or some older Qt5.
271
try:
272
- ratio = self.devicePixelRatio()
273
- if ratio == 0:
274
- return 1
275
- else:
276
- return ratio
+ return self.devicePixelRatio() or 1 # can be 0 in rare cases
277
except AttributeError:
278
return 1
279
0 commit comments