class_docstr: A renderer class inheriting from base for rendering mpl plots in plotly.
  
  A renderer class to be used with an exporter for rendering matplotlib
  plots in Plotly. This module defines the PlotlyRenderer class which handles
  the creation of the JSON structures that get sent to plotly.
  
  All class attributes available are defined in __init__().
  
  Basic Usage:
  
  # (mpl code) #
  fig = gcf()
  renderer = PlotlyRenderer(fig)
  exporter = Exporter(renderer)
  exporter.run(fig)  # ... et voila
docstr: Creates a new figure by beginning to fill out layout dict.
  
  The 'autosize' key is set to false so that the figure will mirror
  sizes set by mpl. The 'hovermode' key controls what shows up when you
  mouse around a figure in plotly, it's set to show the 'closest' point.
  
  Positional agurments:
  fig -- a matplotlib.figure.Figure object.
  props.keys(): [
      'figwidth',
      'figheight',
      'dpi'
      ]
docstr_tok: ["Creates","a","new","figure","by","beginning","to","fill","out","layout","dict",".","The","'autosize","'","key","is","set","to","false","so","that","the","figure","will","mirror","sizes","set","by","mpl",".","The","'hovermode","'","key","controls","what","shows","up","when","you","mouse","around","a","figure","in","plotly",",","it","'s","set","to","show","the","'closest","'","point",".","Positional","agurments",":","fig","--","a","matplotlib.figure.Figure","object",".","props.keys","(",")",":","[","'figwidth","'",",","'figheight","'",",","'dpi'","]"]
code: def open_figure(self, fig, props):
      """Creates a new figure by beginning to fill out layout dict.
  
      The 'autosize' key is set to false so that the figure will mirror
      sizes set by mpl. The 'hovermode' key controls what shows up when you
      mouse around a figure in plotly, it's set to show the 'closest' point.
  
      Positional agurments:
      fig -- a matplotlib.figure.Figure object.
      props.keys(): [
          'figwidth',
          'figheight',
          'dpi'
          ]
  
      """
      self.msg += "Opening figure\n"
      self.mpl_fig = fig
      self.plotly_fig["layout"] = go.Layout(
          width=int(props["figwidth"] * props["dpi"]),
          height=int(props["figheight"] * props["dpi"]),
          autosize=False,
          hovermode="closest",
      )
      self.mpl_x_bounds, self.mpl_y_bounds = mpltools.get_axes_bounds(
          fig
      )
      margin = go.layout.Margin(
          l=int(
              self.mpl_x_bounds[0] * self.plotly_fig["layout"]["width"]
          ),
          r=int(
              (1 - self.mpl_x_bounds[1])
              * self.plotly_fig["layout"]["width"]
          ),
          t=int(
              (1 - self.mpl_y_bounds[1])
              * self.plotly_fig["layout"]["height"]
          ),
          b=int(
              self.mpl_y_bounds[0] * self.plotly_fig["layout"]["height"]
          ),
          pad=0,
      )
      self.plotly_fig["layout"]["margin"] = margin
  
imports: import warnings
  import plotly.graph_objs
  from plotly.matplotlylib.mplexporter import Renderer
  from plotly.matplotlylib import mpltools
label_desc: Use image node_id 2 for calling the PlotlyRenderer obj's underlying member method code with example usage: obj.open_figure(fig, props) without return types