docstr: Write the figure to a PNG file.
  
  Parameters
  ----------
  filename_or_obj : str or path-like or file-like
      The file to write to.
  
  metadata : dict, optional
      Metadata in the PNG file as key-value pairs of bytes or latin-1
      encodable strings.
      According to the PNG specification, keys must be shorter than 79
      chars.
  
      The `PNG specification`_ defines some common keywords that may be
      used as appropriate:
  
      - Title: Short (one line) title or caption for image.
      - Author: Name of image's creator.
      - Description: Description of image (possibly long).
      - Copyright: Copyright notice.
      - Creation Time: Time of original image creation
        (usually RFC 1123 format).
      - Software: Software used to create the image.
      - Disclaimer: Legal disclaimer.
      - Warning: Warning of nature of content.
      - Source: Device used to create the image.
      - Comment: Miscellaneous comment;
        conversion from other image format.
  
      Other keywords may be invented for other purposes.
  
      If 'Software' is not given, an autogenerated value for Matplotlib
      will be used.  This can be removed by setting it to *None*.
  
      For more details see the `PNG specification`_.
  
      .. _PNG specification:                 https://www.w3.org/TR/2003/REC-PNG-20031110/#11keywords
  
  pil_kwargs : dict, optional
      Keyword arguments passed to `PIL.Image.Image.save`.
  
      If the 'pnginfo' key is present, it completely overrides
      *metadata*, including the default 'Software' key.
code: def print_png(
      self, filename_or_obj, *, metadata=None, pil_kwargs=None
  ):
      """
          Write the figure to a PNG file.
  
          Parameters
          ----------
          filename_or_obj : str or path-like or file-like
              The file to write to.
  
          metadata : dict, optional
              Metadata in the PNG file as key-value pairs of bytes or latin-1
              encodable strings.
              According to the PNG specification, keys must be shorter than 79
              chars.
  
              The `PNG specification`_ defines some common keywords that may be
              used as appropriate:
  
              - Title: Short (one line) title or caption for image.
              - Author: Name of image's creator.
              - Description: Description of image (possibly long).
              - Copyright: Copyright notice.
              - Creation Time: Time of original image creation
                (usually RFC 1123 format).
              - Software: Software used to create the image.
              - Disclaimer: Legal disclaimer.
              - Warning: Warning of nature of content.
              - Source: Device used to create the image.
              - Comment: Miscellaneous comment;
                conversion from other image format.
  
              Other keywords may be invented for other purposes.
  
              If 'Software' is not given, an autogenerated value for Matplotlib
              will be used.  This can be removed by setting it to *None*.
  
              For more details see the `PNG specification`_.
  
              .. _PNG specification: \
                  https://www.w3.org/TR/2003/REC-PNG-20031110/#11keywords
  
          pil_kwargs : dict, optional
              Keyword arguments passed to `PIL.Image.Image.save`.
  
              If the 'pnginfo' key is present, it completely overrides
              *metadata*, including the default 'Software' key.
          """
      self._print_pil(filename_or_obj, "png", pil_kwargs, metadata)
  
imports: from contextlib import nullcontext
  from math import radians, cos, sin
  import numpy
  import matplotlib
  from matplotlib import _api, cbook
  from matplotlib.backend_bases import _Backend, FigureCanvasBase, FigureManagerBase, RendererBase
  from matplotlib.font_manager import fontManager, get_font
  from matplotlib.ft2font import LOAD_FORCE_AUTOHINT, LOAD_NO_HINTING, LOAD_DEFAULT, LOAD_NO_AUTOHINT
  from matplotlib.mathtext import MathTextParser
  from matplotlib.path import Path
  from matplotlib.transforms import Bbox, BboxBase
  from matplotlib.backends._backend_agg import RendererAgg
label_desc: Use image node_id 10 for calling the FigureCanvasAgg obj's underlying member method code with example usage: obj.print_png(filename_or_obj) without return types