code: def test_plot_series_output_type(series_to_plot):
      """Tests whether plot_series returns plt.fig and plt.ax."""
      _check_soft_dependencies("matplotlib")
      import matplotlib
      import matplotlib.pyplot as plt
  
      matplotlib.use("agg")
      # Test output case where kwarg ax=None
      fig, ax = _plot_series(series_to_plot)
  
      is_fig_figure = isinstance(fig, plt.Figure)
      is_ax_axis = isinstance(ax, plt.Axes)
  
      assert is_fig_figure and is_ax_axis, "".join(
          [
              "plot_series with kwarg ax=None should return plt.Figure and plt.Axes,",
              f"but returned: {type(fig)} and {type(ax)}",
          ]
      )
  
      # Test output case where an existing plt.Axes object is passed to kwarg ax
      fig, ax = plt.subplots(1, figsize=plt.figaspect(0.25))
      ax = _plot_series(series_to_plot, ax=ax)
  
      is_ax_axis = isinstance(ax, plt.Axes)
  
      assert is_ax_axis, "".join(
          [
              "plot_series with plt.Axes object passed to kwarg ax",
              f"should return plt.Axes, but returned: {type(ax)}",
          ]
      )
  
imports: import re
  import numpy
  import pandas
  import pytest
  from sktime.datasets import load_airline
  from sktime.tests.test_switch import run_test_for_class
  from sktime.utils.plotting import plot_correlations, plot_lags, plot_series
  from sktime.utils.validation._dependencies import _check_soft_dependencies
  from sktime.utils.validation.series import VALID_DATA_TYPES
label_desc: Use image node_id 8 for calling a global function with example usage: test_plot_series_output_type(series_to_plot) without return types