class mlrun.artifacts.plots.PlotArtifact(key=None, body=None, is_inline=False, target_path=None, title=None)[source]#

Bases: Artifact

before_log()[source]#
get_body()[source]#

Convert Matplotlib figure 'fig' into a <img> tag for HTML use using base64 encoding.

kind = 'plot'#
class mlrun.artifacts.plots.PlotlyArtifact(figure: Figure | None = None, key: str | None = None, target_path: str | None = None)[source]#

Bases: Artifact

Plotly artifact is an artifact for saving Plotly generated figures. They will be stored in a html format.

Initialize a Plotly artifact with the given figure.

Parameters:
  • figure -- Plotly figure ('plotly.graph_objs.Figure' object) to save as an artifact.

  • key -- Key for the artifact to be stored in the database.

  • target_path -- Path to save the artifact.

get_body() str[source]#

Get the artifact's body - the Plotly figure's html code.

Returns:

The figure's html code.

kind = 'plotly'#