original_docstring: 
      @brief Convert a Matplotlib figure to a PIL Image in RGBA format and return it
      @param fig a matplotlib figure
      @return a Python Imaging Library ( PIL ) image
      
docstring: @brief Convert a Matplotlib figure to a PIL Image in RGBA format and return it
  @param fig a matplotlib figure
  @return a Python Imaging Library ( PIL ) image
docstring_tokens: @brief Convert a Matplotlib figure to a PIL Image in RGBA format and return it @param fig a matplotlib figure @return a Python Imaging Library ( PIL ) image
code: def fig2img (fig):
      """
      @brief Convert a Matplotlib figure to a PIL Image in RGBA format and return it
      @param fig a matplotlib figure
      @return a Python Imaging Library ( PIL ) image
      """
      # put the figure pixmap into a numpy array
      buf = fig2data (fig)
      w, h, d = buf.shape
      return Image.frombytes("RGBA", (w ,h), buf.tostring())
code_tokens: def fig2img ( fig ) : buf = fig2data ( fig ) w , h , d = buf . shape return Image . frombytes ( "RGBA" , ( w , h ) , buf . tostring ( ) )
short_docstring: @brief Convert a Matplotlib figure to a PIL Image in RGBA format and return it
  @param fig a matplotlib figure
  @return a Python Imaging Library ( PIL ) image
short_docstring_tokens: @brief Convert a Matplotlib figure to a PIL Image in RGBA format and return it @param fig a matplotlib figure @return a Python Imaging Library ( PIL ) image
comment: """
      @brief Convert a Matplotlib figure to a PIL Image in RGBA format and return it
      @param fig a matplotlib figure
      @return a Python Imaging Library ( PIL ) image
      """$SEP$# put the figure pixmap into a numpy array