class_docstr: An image.
  
  `Images can be created directly from PNG/JPG/GIF `bytes`, `PIL.Image`s,
  or Matplotlib figures. Note that the image data is embedded in the card,
  so no external files are required to show the image.
  
  Example: Create an `Image` from bytes:
  ```
  current.card.append(
      Image(
          requests.get("https://www.gif-vif.com/hacker-cat.gif").content,
          "Image From Bytes"
      )
  )
  ```
  
  Example: Create an `Image` from a Matplotlib figure
  ```
  import pandas as pd
  import numpy as np
  current.card.append(
      Image.from_matplotlib(
          pandas.DataFrame(
              np.random.randint(0, 100, size=(15, 4)),
              columns=list("ABCD"),
          ).plot()
      )
  )
  ```
  
  Example: Create an `Image` from a [PIL](https://pillow.readthedocs.io/) Image
  ```
  from PIL import Image as PILImage
  current.card.append(
      Image.from_pil_image(
          PILImage.fromarray(np.random.randn(1024, 768), "RGB"),
          "From PIL Image"
      )
  )
  ```
  
  Parameters
  ----------
  src : bytes
      The image data in `bytes`.
  label : str
      Optional label for the image.
class_docstr_tok: ["An","image",".","`","Images","can","be","created","directly","from","PNG\/JPG\/GIF","`","bytes","`",",","`","PIL.Image","`","s",",","or","Matplotlib","figures",".","Note","that","the","image","data","is","embedded","in","the","card",",","so","no","external","files","are","required","to","show","the","image",".","Example",":","Create","an","`","Image","`","from","bytes",":","``","`","current.card.append","(","Image","(","requests.get","(","``","https",":","\/\/www.gif-vif.com\/hacker-cat.gif","''",")",".content",",","``","Image","From","Bytes","''",")",")","``","`","Example",":","Create","an","`","Image","`","from","a","Matplotlib","figure","``","`","import","pandas","as","pd","import","numpy","as","np","current.card.append","(","Image.from_matplotlib","(","pandas.DataFrame","(","np.random.randint","(","0",",","100",",","size=","(","15",",","4",")",")",",","columns=list","(","``","ABCD","''",")",",",")",".plot","(",")",")",")","``","`","Example",":","Create","an","`","Image","`","from","a","[","PIL","]","(","https",":","\/\/pillow.readthedocs.io\/",")","Image","``","`","from","PIL","import","Image","as","PILImage","current.card.append","(","Image.from_pil_image","(","PILImage.fromarray","(","np.random.randn","(","1024",",","768",")",",","``","RGB","''",")",",","``","From","PIL","Image","''",")",")","``","`","Parameters","--","--","--","--","--","src",":","bytes","The","image","data","in","`","bytes","`",".","label",":","str","Optional","label","for","the","image","."]
docstr: Create an `Image` from a Matplotlib plot.
  
  Parameters
  ----------
  plot :  matplotlib.figure.Figure or matplotlib.axes.Axes or matplotlib.axes._subplots.AxesSubplot
      a PIL axes (plot) object.
  label : str, optional
      Optional label for the image.
docstr_tok: ["Create","an","`","Image","`","from","a","Matplotlib","plot",".","Parameters","--","--","--","--","--","plot",":","matplotlib.figure.Figure","or","matplotlib.axes.Axes","or","matplotlib.axes._subplots.AxesSubplot","a","PIL","axes","(","plot",")","object",".","label",":","str",",","optional","Optional","label","for","the","image","."]
code: def from_matplotlib(
      cls,
      plot,
      label: Optional[str] = None,
      disable_updates: bool = False,
  ):
      """
      Create an `Image` from a Matplotlib plot.
  
      Parameters
      ----------
      plot :  matplotlib.figure.Figure or matplotlib.axes.Axes or matplotlib.axes._subplots.AxesSubplot
          a PIL axes (plot) object.
      label : str, optional
          Optional label for the image.
      """
      try:
          parsed_image, error_comp = cls._parse_matplotlib(plot)
          if parsed_image is not None:
              img = cls(
                  src=parsed_image,
                  label=label,
                  disable_updates=disable_updates,
              )
          else:
              img = cls(
                  src=None, label=label, disable_updates=disable_updates
              )
              img._error_comp = error_comp
          return img
      except:
          import traceback
  
          img = cls(
              src=None, label=label, disable_updates=disable_updates
          )
          img._error_comp = ErrorComponent(
              cls.render_fail_headline(
                  "Matplotlib plot's image is not parsable"
              ),
              "%s" % traceback.format_exc(),
          )
          return img
  
imports: from typing import Any, List, Optional, Union
  from .basic import LogComponent, ErrorComponent, ArtifactsComponent, TableComponent, ImageComponent, SectionComponent, MarkdownComponent
  from .card import MetaflowCardComponent
  from .convert_to_native_type import TaskToDict, _full_classname
  from .renderer_tools import render_safely
  import uuid
label_desc: Use image node_id 12 for calling the Image obj's underlying member method code with example usage: obj.from_matplotlib(cls, plot, label, disable_updates) and returns: img, img