Skip to content

Commit cae796e

Browse files
committed
pep8 and edit message in confirmation to download image
1 parent 151f23e commit cae796e

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

plotly/offline/offline.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ def plot(figure_or_data,
265265
include_plotlyjs=True,
266266
filename='temp-plot.html', auto_open=True,
267267
download_image=False, image_filename='plot', format='png',
268-
_width = 800, _height=600):
268+
_width=800, _height=600):
269269
""" Create a plotly graph locally as an HTML document or string.
270270
271271
Example:
@@ -354,10 +354,11 @@ def plot(figure_or_data,
354354
'function downloadimage(format, height, width,'
355355
' filename) {{'
356356
'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}});'
359359
'}};'
360-
'if(confirm(\'Do you want to save this image?\')) {{'
360+
'if(confirm(\'Do you want to save this image as '
361+
'{filename}.{format}?\')) {{'
361362
'downloadimage(\'{format}\', {height}, {width}, '
362363
'\'{filename}\');}}'
363364
'</script>'
@@ -558,6 +559,7 @@ def enable_mpl_offline(resize=False, strip_style=False,
558559
lambda fig: iplot_mpl(fig, resize, strip_style, verbose,
559560
show_link, link_text, validate))
560561

562+
561563
def download_notebook_image(format='png', height=600, width=800,
562564
filename='newplot'):
563565
"""

0 commit comments

Comments
 (0)