code: def plot_predicted_data(
      training_actual_df,
      predicted_df,
      date_col,
      actual_col,
      pred_col=PredictionKeys.PREDICTION.value,
      prediction_percentiles=None,
      title="",
      test_actual_df=None,
      is_visible=True,
      figsize=None,
      path=None,
      fontsize=None,
      line_plot=False,
      markersize=50,
      lw=2,
      linestyle="-",
  ):
      """plot training actual response together with predicted data; if actual response of predicted
      data is there, plot it too.
  
      Parameters
      ----------
      training_actual_df : pd.DataFrame
          training actual response data frame. two columns required: actual_col and date_col
      predicted_df : pd.DataFrame
          predicted data response data frame. two columns required: actual_col and pred_col. If
          user provide prediction_percentiles, it needs to include them as well in such
          `prediction_{x}` where x is the correspondent percentiles
      prediction_percentiles : list
          list of two elements indicates the lower and upper percentiles
      date_col : str
          the date column name
      actual_col : str
      pred_col : str
      title : str
          title of the plot
      test_actual_df : pd.DataFrame
         test actual response dataframe. two columns required: actual_col and date_col
      is_visible : boolean
          whether we want to show the plot. If called from unittest, is_visible might = False.
      figsize : tuple
          figsize pass through to `matplotlib.pyplot.figure()`
      path : str
          path to save the figure
      fontsize : int; optional
          fontsize of the title
      line_plot : bool; default False
          if True, make line plot for observations; otherwise, make scatter plot for observations
      markersize : int; optional
          point marker size
      lw : int; optional
          out-of-sample prediction line width
      linestyle : str
          linestyle of prediction plot
  
      Returns
      -------
          matplotlib axes object
      """
  
      if is_empty_dataframe(training_actual_df) or is_empty_dataframe(
          predicted_df
      ):
          raise ValueError(
              "No prediction data or training response to plot."
          )
  
      if not is_ordered_datetime(predicted_df[date_col]):
          raise ValueError("Prediction df dates is not ordered.")
  
      plot_confid = False
      if prediction_percentiles is None:
          _pred_percentiles = [5, 95]
      else:
          _pred_percentiles = prediction_percentiles
  
      if len(_pred_percentiles) != 2:
          raise ValueError(
              "prediction_percentiles has to be None or a list with length=2."
          )
  
      confid_cols = [
          "prediction_{}".format(_pred_percentiles[0]),
          "prediction_{}".format(_pred_percentiles[1]),
      ]
  
      if set(confid_cols).issubset(predicted_df.columns):
          plot_confid = True
  
      if not figsize:
          figsize = (16, 8)
  
      if not fontsize:
          fontsize = 16
  
      _training_actual_df = training_actual_df.copy()
      _predicted_df = predicted_df.copy()
      _training_actual_df[date_col] = pd.to_datetime(
          _training_actual_df[date_col]
      )
      _predicted_df[date_col] = pd.to_datetime(_predicted_df[date_col])
  
      fig, ax = plt.subplots(facecolor="w", figsize=figsize)
  
      if line_plot:
          ax.plot(
              _training_actual_df[date_col].values,
              _training_actual_df[actual_col].values,
              marker=None,
              color=PredPal.ACTUAL_OBS.value,
              lw=lw,
              label="train response",
              linestyle=linestyle,
          )
      else:
          ax.scatter(
              _training_actual_df[date_col].values,
              _training_actual_df[actual_col].values,
              marker=".",
              color=PredPal.ACTUAL_OBS.value,
              alpha=0.8,
              s=markersize,
              label="train response",
          )
  
      ax.plot(
          _predicted_df[date_col].values,
          _predicted_df[pred_col].values,
          marker=None,
          color=PredPal.PREDICTION_LINE.value,
          lw=lw,
          label=PredictionKeys.PREDICTION.value,
          linestyle=linestyle,
      )
  
      # vertical line separate training and prediction
      if (
          _training_actual_df[date_col].values[-1]
          < _predicted_df[date_col].values[-1]
      ):
          ax.axvline(
              x=_training_actual_df[date_col].values[-1],
              color=PredPal.HOLDOUT_VERTICAL_LINE.value,
              alpha=0.5,
              linestyle="--",
          )
  
      if test_actual_df is not None:
          test_actual_df = test_actual_df.copy()
          test_actual_df[date_col] = pd.to_datetime(
              test_actual_df[date_col]
          )
          if line_plot:
              ax.plot(
                  test_actual_df[date_col].values,
                  test_actual_df[actual_col].values,
                  marker=None,
                  color=PredPal.TEST_OBS.value,
                  lw=lw,
                  label="train response",
                  linestyle=linestyle,
              )
          else:
              ax.scatter(
                  test_actual_df[date_col].values,
                  test_actual_df[actual_col].values,
                  marker=".",
                  color=PredPal.TEST_OBS.value,
                  s=markersize,
                  label="test response",
              )
  
      # prediction intervals
      if plot_confid:
          ax.fill_between(
              _predicted_df[date_col].values,
              _predicted_df[confid_cols[0]],
              _predicted_df[confid_cols[1]],
              facecolor=PredPal.PREDICTION_INTERVAL.value,
              alpha=0.3,
          )
  
      ax.set_title(title, fontsize=fontsize)
      # ax.grid(True, which='major', c='gray', ls='-', lw=1, alpha=0.5) --comment out since we have orbit style
      ax.legend()
      if path:
          fig.savefig(path)
      if is_visible:
          plt.show()
      else:
          plt.close()
  
      return ax
  
imports: import matplotlib.pyplot
  import seaborn
  import pandas
  import numpy
  import math
  import os
  import pkg_resources
  import statsmodels.api
  from scipy import stats
  from ..constants.constants import PredictionKeys
  from orbit.utils.general import is_empty_dataframe, is_ordered_datetime
  from ..constants.constants import BacktestFitKeys
  from ..constants.palette import PredictionPaletteClassic
  from orbit.constants import palette
  from orbit.diagnostics.metrics import smape
  from orbit.utils.plot import orbit_style_decorator
  from ..exceptions import PlotException
  import logging
label_desc: Use image node_id 1 for calling a global function with example usage: plot_predicted_data(training_actual_df, predicted_df, date_col, actual_col, pred_col, prediction_percentiles, title, test_actual_df, is_visible, figsize, path, fontsize, line_plot, markersize, lw, linestyle) and returns: ax