@@ -71,8 +71,8 @@ def init_notebook_mode():
7171 '</script>' ))
7272
7373
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 ):
7676
7777 figure = tools .return_figure_from_figure_or_data (figure_or_data , validate )
7878
@@ -157,7 +157,7 @@ def _plot_html(figure_or_data, show_link, link_text,
157157 return plotly_html_div , plotdivid , width , height
158158
159159
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'} ,
161161 validate = True ):
162162 """
163163 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',
205205 from IPython .display import HTML , display
206206
207207 plot_html , plotdivid , width , height = _plot_html (
208- figure_or_data , show_link , link_text , validate ,
208+ figure_or_data , config , validate ,
209209 '100%' , 525 )
210210
211211 display (HTML (plot_html ))
212212
213213
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' },
216215 validate = True , output_type = 'file' ,
217216 include_plotlyjs = True ,
218217 filename = 'temp-plot.html' ,
@@ -274,7 +273,7 @@ def plot(figure_or_data,
274273 filename += '.html'
275274
276275 plot_html , plotdivid , width , height = _plot_html (
277- figure_or_data , show_link , link_text , validate ,
276+ figure_or_data , config , validate ,
278277 '100%' , '100%' )
279278
280279 figure = tools .return_figure_from_figure_or_data (figure_or_data , validate )
@@ -332,7 +331,7 @@ def plot(figure_or_data,
332331
333332
334333def 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'} ,
336335 validate = True , output_type = 'file' , include_plotlyjs = True ,
337336 filename = 'temp-plot.html' , auto_open = True ):
338337 """
@@ -395,13 +394,13 @@ def plot_mpl(mpl_fig, resize=False, strip_style=False,
395394 ```
396395 """
397396 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 ,
399398 include_plotlyjs , filename , auto_open )
400399
401400
402401def 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 ):
405404 """
406405 Convert a matplotlib figure to a plotly graph and plot inside an IPython
407406 notebook without connecting to an external server.
@@ -450,7 +449,7 @@ def iplot_mpl(mpl_fig, resize=False, strip_style=False,
450449 ```
451450 """
452451 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 )
454453
455454
456455def enable_mpl_offline (resize = False , strip_style = False ,
0 commit comments