@@ -104,8 +104,7 @@ def export(self):
104
104
buf = io .BytesIO ()
105
105
self .canvas .figure .savefig (buf , format = 'png' , dpi = 'figure' )
106
106
# 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 ()
109
108
# Scale size to match widget on HiDPI monitors.
110
109
if hasattr (self .canvas , 'device_pixel_ratio' ): # Matplotlib 3.5+
111
110
width = pwidth / self .canvas .device_pixel_ratio
@@ -292,17 +291,18 @@ def _repr_mimebundle_(self, **kwargs):
292
291
self .figure .savefig (buf , format = 'png' , dpi = 'figure' )
293
292
self ._data_url = b64encode (buf .getvalue ()).decode ('utf-8' )
294
293
# 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 ()
297
295
# Scale size to match widget on HiDPI monitors.
298
296
if hasattr (self , 'device_pixel_ratio' ): # Matplotlib 3.5+
299
297
width = pwidth / self .device_pixel_ratio
300
298
else :
301
299
width = pwidth / self ._dpi_ratio
302
300
html = """
303
301
<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={}/>
306
306
</div>
307
307
""" .format (
308
308
self ._figure_label , self ._data_url , width
0 commit comments