class_docstr: An experiment instance used to log values
class_docstr_tok: ["An","experiment","instance","used","to","log","values"]
docstr: Log a matplotlib figure
  
  >>> import matplotlib.pyplot as plt
  >>> from sklearn_evaluation import SQLiteTracker
  >>> tracker = SQLiteTracker("experiments.db")
  >>> fig, ax = plt.subplots()
  >>> ax.scatter([1, 2, 3], [1, 2, 3]) # doctest: +SKIP
  >>> exp = tracker.new_experiment()
  >>> exp.log_figure("scatter", fig)
  >>> data = tracker.get(exp.uuid)
  >>> data['scatter'] # doctest: +SKIP
docstr_tok: ["Log","a","matplotlib","figure",">",">",">","import","matplotlib.pyplot","as","plt",">",">",">","from","sklearn_evaluation","import","SQLiteTracker",">",">",">","tracker","=","SQLiteTracker","(","``","experiments.db","''",")",">",">",">","fig",",","ax","=","plt.subplots","(",")",">",">",">","ax.scatter","(","[","1",",","2",",","3","]",",","[","1",",","2",",","3","]",")","#","doctest",":","+SKIP",">",">",">","exp","=","tracker.new_experiment","(",")",">",">",">","exp.log_figure","(","``","scatter","''",",","fig",")",">",">",">","data","=","tracker.get","(","exp.uuid",")",">",">",">","data","[","'scatter","'","]","#","doctest",":","+SKIP"]
code: def log_figure(self, key, fig):
      """Log a matplotlib figure
  
      >>> import matplotlib.pyplot as plt
      >>> from sklearn_evaluation import SQLiteTracker
      >>> tracker = SQLiteTracker("experiments.db")
      >>> fig, ax = plt.subplots()
      >>> ax.scatter([1, 2, 3], [1, 2, 3]) # doctest: +SKIP
      >>> exp = tracker.new_experiment()
      >>> exp.log_figure("scatter", fig)
      >>> data = tracker.get(exp.uuid)
      >>> data['scatter'] # doctest: +SKIP
      """
      self._tracker.upsert(self._uuid, {key: figure2html(fig)})
  
imports: from collections.abc import Mapping
  from uuid import uuid4
  import sqlite3
  import json
  import importlib
  import pandas
  from jinja2 import Template
  from sklearn_evaluation.table import Table
  from sklearn_evaluation.report.serialize import try_serialize_figures, figure2html
  from sklearn_evaluation.telemetry import SKLearnEvaluationLogger
  from sklearn_evaluation.nb.NotebookCollection import add_compare_tab, tabs_html_from_content, HTMLMapping
  from sklearn_evaluation import plot
label_desc: Use image node_id 8 for calling the Experiment obj's underlying member method code with example usage: obj.log_figure(key, fig) without return types