Repository: plotly/plotly.py

Issue:
Chaining fig.update()
Based on previous conversations, this would be a nice improvement :)

Discussion:

Patch:
diff --git a/plotly/basedatatypes.py b/plotly/basedatatypes.py
index 4c786bc1d..a0c3f057d 100644
--- a/plotly/basedatatypes.py
+++ b/plotly/basedatatypes.py
@@ -3023,6 +3023,8 @@ class BasePlotlyType(object):
             BaseFigure._perform_update(self, dict1)
             BaseFigure._perform_update(self, kwargs)
 
+        return self
+
     @property
     def _in_batch_mode(self):
         """
diff --git a/plotly/matplotlylib/renderer.py b/plotly/matplotlylib/renderer.py
index aca990da9..3d5897a9e 100644
--- a/plotly/matplotlylib/renderer.py
+++ b/plotly/matplotlylib/renderer.py
@@ -735,5 +735,4 @@ class PlotlyRenderer(Renderer):
                 pass
 
     def strip_style(self):
-        self.msg += "Stripping mpl style, deleting keys from data and layout\n"
-        self.plotly_fig.strip_style()
+        self.msg += "Stripping mpl style is no longer supported\n"
diff --git a/plotly/plotly/plotly.py b/plotly/plotly/plotly.py
index 88bf1ca98..a5280c219 100644
--- a/plotly/plotly/plotly.py
+++ b/plotly/plotly/plotly.py
@@ -276,7 +276,6 @@ def iplot_mpl(fig, resize=True, strip_style=False, update=None,
     fig = tools.mpl_to_plotly(fig, resize=resize, strip_style=strip_style)
     if update and isinstance(update, dict):
         fig.update(update)
-        fig.validate()
     elif update is not None:
         raise exceptions.PlotlyGraphObjectError(
             "'update' must be dictionary-like and a valid plotly Figure "


Test patch:
diff --git a/plotly/tests/test_core/test_graph_objs/test_update.py b/plotly/tests/test_core/test_graph_objs/test_update.py
index 69c71dd03..7932c7c79 100644
--- a/plotly/tests/test_core/test_graph_objs/test_update.py
+++ b/plotly/tests/test_core/test_graph_objs/test_update.py
@@ -15,10 +15,12 @@ class TestUpdateMethod(TestCase):
     def test_update_dict(self):
         title = 'this'
         fig = Figure()
-        fig.update(layout=Layout(title=title))
+        update_res1 = fig.update(layout=Layout(title=title))
         assert fig == Figure(layout=Layout(title=title))
-        fig['layout'].update(xaxis=XAxis())
+        update_res2 = fig['layout'].update(xaxis=XAxis())
         assert fig == Figure(layout=Layout(title=title, xaxis=XAxis()))
+        assert update_res1 is fig
+        assert update_res2 is fig.layout
 
 
     def test_update_list(self):
@@ -26,24 +28,27 @@ class TestUpdateMethod(TestCase):
         trace2 = Scatter(x=[1, 2, 3], y=[3, 2, 1])
         fig = Figure([trace1, trace2])
         update = dict(x=[2, 3, 4], y=[1, 2, 3])
-        fig.data[0].update(update)
-        fig.data[1].update(update)
+        update_res1 = fig.data[0].update(update)
+        update_res2 = fig.data[1].update(update)
 
         d1, d2 = strip_dict_params(fig.data[0], Scatter(x=[2, 3, 4], y=[1, 2, 3]))
         assert d1 == d2
         d1, d2 = strip_dict_params(fig.data[1], Scatter(x=[2, 3, 4], y=[1, 2, 3]))
         assert d1 == d2
+        assert update_res1 is fig.data[0]
+        assert update_res2 is fig.data[1]
 
 
     def test_update_dict_empty(self):
         trace1 = Scatter(x=[1, 2, 3], y=[2, 1, 2])
         trace2 = Scatter(x=[1, 2, 3], y=[3, 2, 1])
         fig = Figure([trace1, trace2])
-        fig.update({})
+        update_res = fig.update({})
         d1, d2 = strip_dict_params(fig.data[0], Scatter(x=[1, 2, 3], y=[2, 1, 2]))
         assert d1 == d2
         d1, d2 = strip_dict_params(fig.data[1], Scatter(x=[1, 2, 3], y=[3, 2, 1]))
         assert d1 == d2
+        assert update_res is fig
 
 
     def test_update_list_empty(self):