code: def metric_horizon_barplot(
      df,
      model_col="model",
      pred_horizon_col="pred_horizon",
      metric_col="smape",
      bar_width=0.1,
      path=None,
      figsize=None,
      fontsize=None,
      is_visible=False,
  ):
      if not figsize:
          figsize = [20, 6]
  
      if not fontsize:
          fontsize = 10
  
      plt.rcParams["figure.figsize"] = figsize
      models = df[model_col].unique()
      metric_horizons = df[pred_horizon_col].unique()
      n_models = len(models)
      palette = sns.color_palette("colorblind", n_models)
  
      # set height of bar
      bars = list()
      for m in models:
          bars.append(list(df[df[model_col] == m][metric_col]))
  
      # set position of bar on X axis
      r = list()
      r.append(np.arange(len(bars[0])))
      for idx in range(n_models - 1):
          r.append([x + bar_width for x in r[idx]])
  
      # make the plot
      for idx in range(n_models):
          plt.bar(
              r[idx],
              bars[idx],
              color=palette[idx],
              width=bar_width,
              edgecolor="white",
              label=models[idx],
          )
  
      # add xticks on the middle of the group bars
      plt.xlabel("predict-horizon", fontweight="bold")
      plt.xticks(
          [x + bar_width for x in range(len(bars[0]))], metric_horizons
      )
  
      # create legend & show graphic
      plt.legend()
      plt.title(
          "Model Comparison with {}".format(metric_col),
          fontsize=fontsize,
      )
  
      if path:
          plt.savefig(path)
  
      if is_visible:
          plt.show()
      else:
          plt.close()
  
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 5 for calling a global function with example usage: metric_horizon_barplot(df, model_col, pred_horizon_col, metric_col, bar_width, path, figsize, fontsize, is_visible) without return types