class_docstr: Matplotlib Exporter
  
  Parameters
  ----------
  renderer : Renderer object
      The renderer object called by the exporter to create a figure
      visualization.  See mplexporter.Renderer for information on the
      methods which should be defined within the renderer.
  close_mpl : bool
      If True (default), close the matplotlib figure as it is rendered. This
      is useful for when the exporter is used within the notebook, or with
      an interactive matplotlib backend.
class_docstr_tok: ["Matplotlib","Exporter","Parameters","--","--","--","--","--","renderer",":","Renderer","object","The","renderer","object","called","by","the","exporter","to","create","a","figure","visualization",".","See","mplexporter.Renderer","for","information","on","the","methods","which","should","be","defined","within","the","renderer",".","close_mpl",":","bool","If","True","(","default",")",",","close","the","matplotlib","figure","as","it","is","rendered",".","This","is","useful","for","when","the","exporter","is","used","within","the","notebook",",","or","with","an","interactive","matplotlib","backend","."]
docstr: Crawl the axes and process all elements within
docstr_tok: ["Crawl","the","axes","and","process","all","elements","within"]
code: def crawl_ax(self, ax):
      """Crawl the axes and process all elements within"""
      with self.renderer.draw_axes(
          ax=ax, props=utils.get_axes_properties(ax)
      ):
          for line in ax.lines:
              self.draw_line(ax, line)
          for text in ax.texts:
              self.draw_text(ax, text)
          for text, ttp in zip(
              [ax.xaxis.label, ax.yaxis.label, ax.title],
              ["xlabel", "ylabel", "title"],
          ):
              if hasattr(text, "get_text") and text.get_text():
                  self.draw_text(
                      ax, text, force_trans=ax.transAxes, text_type=ttp
                  )
          for artist in ax.artists:
              # TODO: process other artists
              if isinstance(artist, matplotlib.text.Text):
                  self.draw_text(ax, artist)
          for patch in ax.patches:
              self.draw_patch(ax, patch)
          for collection in ax.collections:
              self.draw_collection(ax, collection)
          for image in ax.images:
              self.draw_image(ax, image)
  
          legend = ax.get_legend()
          if legend is not None:
              props = utils.get_legend_properties(ax, legend)
              with self.renderer.draw_legend(
                  legend=legend, props=props
              ):
                  if props["visible"]:
                      self.crawl_legend(ax, legend)
  
file_path: plotly.py/packages/python/plotly/plotly/matplotlylib/mplexporter/exporter.py
imports: import warnings
  import io
  from .None import utils
  import matplotlib
  from matplotlib import transforms
  from matplotlib.backends.backend_agg import FigureCanvasAgg
label_desc: Use image node_id 5 for calling the Exporter obj's underlying member method code with example usage: obj.crawl_ax(ax) without return types