31
31
32
32
__PLOTLY_OFFLINE_INITIALIZED = False
33
33
34
- __IMAGE_FORMATS = ['jpeg' , 'svg ' , 'webp' , 'svg' ]
34
+ __IMAGE_FORMATS = ['jpeg' , 'png ' , 'webp' , 'svg' ]
35
35
36
36
37
37
def download_plotlyjs (download_url ):
@@ -251,8 +251,10 @@ def iplot(figure_or_data, show_link=True, link_text='Export to plot.ly',
251
251
252
252
if image :
253
253
if image not in __IMAGE_FORMATS :
254
- raise ValueError ('The image parameter takes only the following'
255
- 'format types: `png`, `jpeg`, `webp`, `svg`' )
254
+ raise ValueError ('' .join (['The image parameter takes only the'
255
+ 'following format types: `png`, `jpeg`, `webp`,'
256
+ ' `svg`' ]
257
+ ))
256
258
# if the check passes then download script injection will commence.
257
259
warnings .warn ('For higher resolution images and more export '
258
260
'options, consider making requests to the '
@@ -270,12 +272,12 @@ def iplot(figure_or_data, show_link=True, link_text='Export to plot.ly',
270
272
'downloadimage(\' {format}\' , {height}, {width}, '
271
273
'\' {filename}\' );}}'
272
274
'</script>'
273
- ).format (format = format , width = image_width ,
275
+ ).format (format = image , width = image_width ,
274
276
height = image_height , filename = filename ,
275
277
plot_id = plotdivid )
276
278
# allow time for the plot to draw
277
279
import time
278
- time .sleep (0. 1 )
280
+ time .sleep (1 )
279
281
# inject code to download an image of the plot
280
282
display (HTML (script ))
281
283
@@ -383,7 +385,7 @@ def plot(figure_or_data,
383
385
384
386
if image :
385
387
if image not in __IMAGE_FORMATS :
386
- raise ValueError ('The image parameter takes only the
388
+ raise ValueError ('The image parameter takes only the '
387
389
'following format types: `png`, `jpeg`, '
388
390
'`webp`, `svg`' )
389
391
# if the check passes then download script is injected.
@@ -405,7 +407,7 @@ def plot(figure_or_data,
405
407
'downloadimage(\' {format}\' , {height}, {width}, '
406
408
'\' {filename}\' );}}'
407
409
'</script>'
408
- ).format (format = format , width = image_width ,
410
+ ).format (format = image , width = image_width ,
409
411
height = image_height ,
410
412
filename = image_filename , plot_id = plotdivid )
411
413
else :
@@ -521,8 +523,7 @@ def plot_mpl(mpl_fig, resize=False, strip_style=False,
521
523
return plot (plotly_plot , show_link , link_text , validate , output_type ,
522
524
include_plotlyjs , filename , auto_open ,
523
525
image = image , image_filename = image_filename ,
524
- format = format , image_height = image_height ,
525
- image_width = image_width )
526
+ image_height = image_height , image_width = image_width )
526
527
527
528
528
529
def iplot_mpl (mpl_fig , resize = False , strip_style = False ,
0 commit comments