code: def _plot_figure(self, idx, fig_format='json'):
          
          self.plot.update(idx)
          if self.embed:
              patch = self.renderer.diff(self.plot, binary=False)
              msg = serialize_json(dict(content=patch.content,
                                        root=self.plot.state._id))
              return msg
docs: Returns the figure in html format on the
          first call and