code: def plot_lagged_weights(
      weights, comp_name, focus=None, ax=None, figsize=(10, 6)
  ):
      """Make a barplot of the importance of lagged inputs.
  
      Parameters
      ----------
          weights : list
              tuples of (name, weights)
          comp_name : str
              Name of lagged inputs
          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)
      n_lags = weights.shape[1]
      lags_range = list(range(1, 1 + n_lags))[::-1]
      if focus is None:
          weights = np.sum(np.abs(weights), axis=0)
          weights = weights / np.sum(weights)
          artists += ax.bar(
              lags_range, weights, width=0.80, color="#0072B2"
          )
      else:
          if len(weights.shape) == 2:
              weights = weights[focus - 1, :]
          artists += ax.bar(
              lags_range, weights, width=0.80, color="#0072B2"
          )
      ax.grid(True, which="major", c="gray", ls="-", lw=1, alpha=0.2)
      ax.set_xlabel(f"{comp_name} lag number")
      if focus is None:
          ax.set_ylabel(f"{comp_name} relevance")
          ax = set_y_as_percent(ax)
      else:
          ax.set_ylabel(f"{comp_name} weight ({focus})-ahead")
      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 5 for calling a global function with example usage: plot_lagged_weights(weights, comp_name, focus, ax, figsize) and returns: artists