@@ -71,8 +71,8 @@ def init_notebook_mode():
71
71
'</script>' ))
72
72
73
73
74
- def _plot_html (figure_or_data , show_link , link_text ,
75
- validate , default_width , default_height , config ):
74
+ def _plot_html (figure_or_data , config ,
75
+ validate , default_width , default_height ):
76
76
77
77
figure = tools .return_figure_from_figure_or_data (figure_or_data , validate )
78
78
@@ -157,7 +157,7 @@ def _plot_html(figure_or_data, show_link, link_text,
157
157
return plotly_html_div , plotdivid , width , height
158
158
159
159
160
- def iplot (figure_or_data , show_link = True , link_text = ' Export to plot.ly' ,
160
+ def iplot (figure_or_data , config = { 'show_link' : True , ' link_text' : ' Export to plot.ly'} ,
161
161
validate = True ):
162
162
"""
163
163
Draw plotly graphs inside an IPython notebook without
@@ -205,14 +205,13 @@ def iplot(figure_or_data, show_link=True, link_text='Export to plot.ly',
205
205
from IPython .display import HTML , display
206
206
207
207
plot_html , plotdivid , width , height = _plot_html (
208
- figure_or_data , show_link , link_text , validate ,
208
+ figure_or_data , config , validate ,
209
209
'100%' , 525 )
210
210
211
211
display (HTML (plot_html ))
212
212
213
213
214
- def plot (figure_or_data ,
215
- show_link = True , link_text = 'Export to plot.ly' ,
214
+ def plot (figure_or_data , config = {'show_link' :True , 'link_text' :'Export to plot.ly' },
216
215
validate = True , output_type = 'file' ,
217
216
include_plotlyjs = True ,
218
217
filename = 'temp-plot.html' ,
@@ -274,7 +273,7 @@ def plot(figure_or_data,
274
273
filename += '.html'
275
274
276
275
plot_html , plotdivid , width , height = _plot_html (
277
- figure_or_data , show_link , link_text , validate ,
276
+ figure_or_data , config , validate ,
278
277
'100%' , '100%' )
279
278
280
279
figure = tools .return_figure_from_figure_or_data (figure_or_data , validate )
@@ -332,7 +331,7 @@ def plot(figure_or_data,
332
331
333
332
334
333
def plot_mpl (mpl_fig , resize = False , strip_style = False ,
335
- verbose = False , show_link = True , link_text = ' Export to plot.ly' ,
334
+ verbose = False , config = { 'show_link' : True , ' link_text' : ' Export to plot.ly'} ,
336
335
validate = True , output_type = 'file' , include_plotlyjs = True ,
337
336
filename = 'temp-plot.html' , auto_open = True ):
338
337
"""
@@ -395,13 +394,13 @@ def plot_mpl(mpl_fig, resize=False, strip_style=False,
395
394
```
396
395
"""
397
396
plotly_plot = tools .mpl_to_plotly (mpl_fig , resize , strip_style , verbose )
398
- return plot (plotly_plot , show_link , link_text , validate , output_type ,
397
+ return plot (plotly_plot , config , validate , output_type ,
399
398
include_plotlyjs , filename , auto_open )
400
399
401
400
402
401
def iplot_mpl (mpl_fig , resize = False , strip_style = False ,
403
- verbose = False , show_link = True ,
404
- link_text = 'Export to plot.ly' , validate = True ):
402
+ verbose = False , config = { 'show_link' : True , 'link_text' : 'Export to plot.ly' },
403
+ validate = True ):
405
404
"""
406
405
Convert a matplotlib figure to a plotly graph and plot inside an IPython
407
406
notebook without connecting to an external server.
@@ -450,7 +449,7 @@ def iplot_mpl(mpl_fig, resize=False, strip_style=False,
450
449
```
451
450
"""
452
451
plotly_plot = tools .mpl_to_plotly (mpl_fig , resize , strip_style , verbose )
453
- return iplot (plotly_plot , show_link , link_text , validate )
452
+ return iplot (plotly_plot , config , validate )
454
453
455
454
456
455
def enable_mpl_offline (resize = False , strip_style = False ,
0 commit comments