Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 591a9e0

Browse files
committed
Simplify FigureCanvasQTAgg.__init__
1 parent 6b15984 commit 591a9e0

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

lib/matplotlib/backends/backend_qt5agg.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -194,9 +194,8 @@ def __init__(self, figure):
194194
super(FigureCanvasQTAgg, self).__init__(figure=figure)
195195
# We don't want to scale up the figure DPI more than once.
196196
# Note, we don't handle a signal for changing DPI yet.
197-
if not hasattr(self.figure, '_original_dpi'):
198-
self.figure._original_dpi = self.figure.dpi
199-
self.figure.dpi = self._dpi_ratio * self.figure._original_dpi
197+
self.figure._original_dpi = self.figure.dpi
198+
self._update_figure_dpi()
200199

201200
def _update_figure_dpi(self):
202201
dpi = self._dpi_ratio * self.figure._original_dpi

0 commit comments

Comments
 (0)