code: def _test_plot(self, subdir):
      logger.info("Training model...\n")
      self.model.train(self.vals_train)
  
      figdir = join(rootdir, "tmp", "plot", subdir)
      os.makedirs(figdir, exist_ok=True)
  
      # Test various plots with matplotlib
      fig, ax = self.model.plot_anomaly(
          time_series=self.vals_test,
          filter_scores=False,
          plot_forecast=True,
          plot_forecast_uncertainty=True,
      )
      plot_anoms(ax, self.labels)
      fig.savefig(join(figdir, "prophet_anom_raw.png"))
  
      fig, ax = self.model.plot_anomaly(
          time_series=self.vals_test,
          filter_scores=True,
          plot_forecast=True,
          plot_forecast_uncertainty=True,
      )
      plot_anoms(ax, self.labels)
      fig.savefig(join(figdir, "prophet_anom_filtered.png"))
  
      fig, _ = self.model.plot_forecast(
          time_stamps=self.vals_test.time_stamps,
          time_series_prev=self.vals_train,
          plot_time_series_prev=True,
          plot_forecast_uncertainty=True,
      )
      fig.savefig(join(figdir, "prophet_forecast.png"))
  
      # Test plotting with plotly
      try:
          import plotly
  
          fig1 = self.model.plot_anomaly_plotly(
              time_series=self.vals_test,
              time_series_prev=self.vals_train,
              plot_forecast=True,
              plot_forecast_uncertainty=True,
              plot_time_series_prev=True,
          )
          plot_anoms_plotly(fig1, self.labels)
  
          fig2 = self.model.plot_forecast_plotly(
              time_series=self.vals_test,
              plot_forecast_uncertainty=False,
          )
          try:
              import kaleido
  
              fig1.write_image(
                  (join(figdir, "prophet_plotly.png")), engine="kaleido"
              )
              fig2.write_image(
                  (join(figdir, "prophet_forecast_plotly.png")),
                  engine="kaleido",
              )
          except ImportError:
              logger.info(
                  "kaleido not installed, not trying to save image"
              )
      except ImportError:
          logger.info(
              "plotly not installed, not trying plotly visualization"
          )
  
imports: import logging
  import math
  import os
  from os.path import abspath, dirname, join
  import sys
  import unittest
  from merlion.transform.base import Identity
  from merlion.transform.moving_average import DifferenceTransform
  from merlion.transform.normalize import BoxCoxTransform
  from merlion.transform.resample import TemporalResample
  from merlion.models.anomaly.forecast_based.prophet import ProphetDetector, ProphetDetectorConfig
  from merlion.models.forecast.trees import LGBMForecaster, LGBMForecasterConfig
  from merlion.plot import plot_anoms, plot_anoms_plotly
  from merlion.utils.data_io import csv_to_time_series
label_desc: Use image node_id 6 for calling the TestPlot obj's underlying member method code with example usage: obj._test_plot(subdir) without return types