@@ -265,7 +265,7 @@ def plot(figure_or_data,
265
265
include_plotlyjs = True ,
266
266
filename = 'temp-plot.html' , auto_open = True ,
267
267
download_image = False , image_filename = 'plot' , format = 'png' ,
268
- _width = 800 , _height = 600 ):
268
+ _width = 800 , _height = 600 ):
269
269
""" Create a plotly graph locally as an HTML document or string.
270
270
271
271
Example:
@@ -354,10 +354,11 @@ def plot(figure_or_data,
354
354
'function downloadimage(format, height, width,'
355
355
' filename) {{'
356
356
'var p = document.getElementById(\' {plot_id}\' );'
357
- 'Plotly.downloadImage(p, {{format: format, height: height, '
358
- 'width: width, filename: filename}});'
357
+ 'Plotly.downloadImage(p, {{format: format, height: '
358
+ 'height, width: width, filename: filename}});'
359
359
'}};'
360
- 'if(confirm(\' Do you want to save this image?\' )) {{'
360
+ 'if(confirm(\' Do you want to save this image as '
361
+ '{filename}.{format}?\' )) {{'
361
362
'downloadimage(\' {format}\' , {height}, {width}, '
362
363
'\' {filename}\' );}}'
363
364
'</script>'
@@ -558,6 +559,7 @@ def enable_mpl_offline(resize=False, strip_style=False,
558
559
lambda fig : iplot_mpl (fig , resize , strip_style , verbose ,
559
560
show_link , link_text , validate ))
560
561
562
+
561
563
def download_notebook_image (format = 'png' , height = 600 , width = 800 ,
562
564
filename = 'newplot' ):
563
565
"""
0 commit comments