code: def plot_scalar_weights(
      weights, plot_name, focus=None, ax=None, figsize=(10, 6)
  ):
      """Make a barplot of the regressor weights.
  
      Parameters
      ----------
          weights : list
              tuples of (name, weights)
          plot_name : str
              Name of the plot Title
          focus : int
              Show weights for this forecast, if provided
          ax : matplotlib axis
              Matplotlib Axes to plot on
          figsize : tuple
              Width, height in inches, ignored if ax is not None.
  
              Note
              ----
              Default value is set to ``figsize = (10, 6)``
  
      Returns
      -------
          matplotlib.artist.Artist
              List of Artist objects containing barplot
      """
      artists = []
      if not ax:
          fig = plt.figure(facecolor="w", figsize=figsize)
          ax = fig.add_subplot(111)
      # if len(regressors) == 1:
      # else:
      names = []
      values = []
      for name, weights in weights:
          names.append(name)
          weight = np.squeeze(weights)
          if len(weight.shape) > 1:
              raise ValueError("Not scalar " + plot_name)
          if len(weight.shape) == 1 and len(weight) > 1:
              if focus is not None:
                  weight = weight[focus - 1]
              else:
                  weight = np.mean(weight)
          values.append(weight)
      artists += ax.bar(names, values, width=0.8, color="#0072B2")
      ax.grid(True, which="major", c="gray", ls="-", lw=1, alpha=0.2)
      ax.set_xlabel(plot_name + " name")
      xticks = ax.get_xticklabels()
      if len("_".join(names)) > 100:
          for tick in xticks:
              tick.set_ha("right")
              tick.set_rotation(20)
      if "lagged" in plot_name.lower():
          if focus is None:
              ax.set_ylabel(plot_name + " weight (avg)")
          else:
              ax.set_ylabel(plot_name + f" weight ({focus})-ahead")
      else:
          ax.set_ylabel(plot_name + " weight")
      return artists
  
file_path: neural_prophet/neuralprophet/plot_model_parameters_matplotlib.py
imports: import datetime
  import logging
  import numpy
  import pandas
  from neuralprophet.plot_utils import predict_one_season, predict_season_from_dates, set_y_as_percent
label_desc: Use image node_id 4 for calling a global function with example usage: plot_scalar_weights(weights, plot_name, focus, ax, figsize) and returns: artists