code: def test_log_figure_matplotlib(subdir):
      import matplotlib.pyplot as plt
  
      filename = "figure.png"
      artifact_file = (
          filename
          if subdir is None
          else posixpath.join(subdir, filename)
      )
  
      fig, ax = plt.subplots()
      ax.plot([0, 1], [2, 3])
  
      with mlflow.start_run():
          mlflow.log_figure(fig, artifact_file)
          plt.close(fig)
  
          artifact_path = (
              None if subdir is None else posixpath.normpath(subdir)
          )
          artifact_uri = mlflow.get_artifact_uri(artifact_path)
          run_artifact_dir = local_file_uri_to_path(artifact_uri)
          assert os.listdir(run_artifact_dir) == [filename]
  
file_path: mlflow/tests/tracking/test_log_figure.py
imports: import os
  import posixpath
  import uuid
  import pytest
  import mlflow
  from mlflow.utils.file_utils import local_file_uri_to_path
  from mlflow.utils.os import is_windows
label_desc: Use image node_id 1 for calling a global function with example usage: test_log_figure_matplotlib(subdir) without return types