Skip to content

Commit eed758f

Browse files
pre-commit-ci[bot]martinRenou
authored andcommitted
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 46a955f commit eed758f

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

ipympl/backend_nbagg.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,7 @@ def export(self):
104104
buf = io.BytesIO()
105105
self.canvas.figure.savefig(buf, format='png', dpi='figure')
106106
# Figure width in pixels
107-
pwidth = (self.canvas.figure.get_figwidth() *
108-
self.canvas.figure.get_dpi())
107+
pwidth = self.canvas.figure.get_figwidth() * self.canvas.figure.get_dpi()
109108
# Scale size to match widget on HiDPI monitors.
110109
if hasattr(self.canvas, 'device_pixel_ratio'): # Matplotlib 3.5+
111110
width = pwidth / self.canvas.device_pixel_ratio
@@ -292,17 +291,18 @@ def _repr_mimebundle_(self, **kwargs):
292291
self.figure.savefig(buf, format='png', dpi='figure')
293292
self._data_url = b64encode(buf.getvalue()).decode('utf-8')
294293
# Figure width in pixels
295-
pwidth = (self.figure.get_figwidth() *
296-
self.figure.get_dpi())
294+
pwidth = self.figure.get_figwidth() * self.figure.get_dpi()
297295
# Scale size to match widget on HiDPI monitors.
298296
if hasattr(self, 'device_pixel_ratio'): # Matplotlib 3.5+
299297
width = pwidth / self.device_pixel_ratio
300298
else:
301299
width = pwidth / self._dpi_ratio
302300
html = """
303301
<div style="display: inline-block;">
304-
<div class="jupyter-widgets widget-label" style="text-align: center;">{0}</div>
305-
<img src='data:image/png;base64,{1}' width={2}/>
302+
<div class="jupyter-widgets widget-label" style="text-align: center;">
303+
{}
304+
</div>
305+
<img src='data:image/png;base64,{}' width={}/>
306306
</div>
307307
""".format(
308308
self._figure_label, self._data_url, width

0 commit comments

Comments
 (0)