@@ -195,7 +195,7 @@ def plot(figure_or_data, validate=True, **plot_options):
195
195
raise exceptions .PlotlyAccountError (res ['error' ])
196
196
197
197
198
- def iplot_mpl (fig , resize = True , strip_style = False , ** plot_options ):
198
+ def iplot_mpl (fig , resize = True , strip_style = False , update = None , ** plot_options ):
199
199
"""Replot a matplotlib figure with plotly in IPython.
200
200
201
201
This function:
@@ -215,10 +215,13 @@ def iplot_mpl(fig, resize=True, strip_style=False, **plot_options):
215
215
216
216
"""
217
217
fig = tools .mpl_to_plotly (fig , resize = resize , strip_style = strip_style )
218
+ if update :
219
+ update_fig = tools .get_valid_graph_obj (update , 'Figure' )
220
+ fig .update (update_fig )
218
221
return iplot (fig , ** plot_options )
219
222
220
223
221
- def plot_mpl (fig , resize = True , strip_style = False , ** plot_options ):
224
+ def plot_mpl (fig , resize = True , strip_style = False , update = None , ** plot_options ):
222
225
"""Replot a matplotlib figure with plotly.
223
226
224
227
This function:
@@ -238,6 +241,9 @@ def plot_mpl(fig, resize=True, strip_style=False, **plot_options):
238
241
239
242
"""
240
243
fig = tools .mpl_to_plotly (fig , resize = resize , strip_style = strip_style )
244
+ if update :
245
+ update_fig = tools .get_valid_graph_obj (update , 'Figure' )
246
+ fig .update (update_fig )
241
247
return plot (fig , ** plot_options )
242
248
243
249
0 commit comments