code: def plot_components(
      m,
      fcst,
      plot_configuration,
      df_name="__df__",
      quantile=0.5,
      one_period_per_season=False,
      figsize=None,
  ):
      """Plot the NeuralProphet forecast components.
  
      Parameters
      ----------
          m : NeuralProphet
              Fitted model
          fcst : pd.DataFrame
              Output of m.predict
          plot_configuration: dict
              dict of configured components to plot
          df_name : str
              ID from time series that should be plotted
          quantile : float
              Quantile for which the forecast components are to be plotted
          one_period_per_season : bool
              Plot one period per season, instead of the true seasonal components of the forecast.
          figsize : tuple
              Width, height in inches.
  
              Note
              ----
              Default value is set to ``None`` ->  automatic ``figsize = (10, 3 * npanel)``
  
      Returns
      -------
          matplotlib.pyplot.figure
              Figure showing the NeuralProphet forecast components
      """
      log.debug("Plotting forecast components")
      fcst = fcst.fillna(value=np.nan)
      components_to_plot = plot_configuration["components_list"]
  
      # set number of axes based on selected plot_names and sort them according to order in components
      panel_names = list(
          set(
              next(iter(dic.values())).lower()
              for dic in components_to_plot
          )
      )
      panel_order = [
          x
          for dic in components_to_plot
          for x in panel_names
          if x in dic["plot_name"].lower()
      ]
      npanel = len(panel_names)
      figsize = figsize if figsize else (10, 3 * npanel)
      fig, axes = plt.subplots(
          npanel, 1, facecolor="w", figsize=figsize
      )
      if npanel == 1:
          axes = [axes]
      multiplicative_axes = []
      ax = 0
      # for ax, comp in zip(axes, components):
      for comp in components_to_plot:
          name = comp["plot_name"].lower()
          ax = axes[panel_order.index(name)]
          if (
              name in ["trend"]
              or ("ar" in name and "ahead" in name)
              or ("lagged regressor" in name and "ahead" in name)
              or ("uncertainty" in name)
          ):
              plot_forecast_component(fcst=fcst, ax=ax, **comp)
          elif "event" in name or "future regressor" in name:
              if (
                  "multiplicative" in comp.keys()
                  and comp["multiplicative"]
              ):
                  multiplicative_axes.append(ax)
              plot_forecast_component(fcst=fcst, ax=ax, **comp)
          elif "season" in name:
              if m.config_seasonality.mode == "multiplicative":
                  multiplicative_axes.append(ax)
              if one_period_per_season:
                  comp_name = comp["comp_name"]
                  if (
                      comp_name.lower() == "weekly"
                      or m.config_seasonality.periods[comp_name].period
                      == 7
                  ):
                      plot_weekly(
                          m=m,
                          ax=ax,
                          quantile=quantile,
                          comp_name=comp_name,
                          df_name=df_name,
                      )
                  elif (
                      comp_name.lower() == "yearly"
                      or m.config_seasonality.periods[comp_name].period
                      == 365.25
                  ):
                      plot_yearly(
                          m=m,
                          ax=ax,
                          quantile=quantile,
                          comp_name=comp_name,
                          df_name=df_name,
                      )
                  elif (
                      comp_name.lower() == "daily"
                      or m.config_seasonality.periods[comp_name].period
                      == 1
                  ):
                      plot_daily(
                          m=m,
                          ax=ax,
                          quantile=quantile,
                          comp_name=comp_name,
                          df_name=df_name,
                      )
                  else:
                      plot_custom_season(
                          m=m,
                          ax=ax,
                          quantile=quantile,
                          comp_name=comp_name,
                          df_name=df_name,
                      )
              else:
                  comp_name = f"season_{comp['comp_name']}"
                  plot_forecast_component(
                      fcst=fcst,
                      ax=ax,
                      comp_name=comp_name,
                      plot_name=comp["plot_name"],
                  )
          elif "auto-regression" in name or "lagged regressor" in name:
              plot_multiforecast_component(fcst=fcst, ax=ax, **comp)
  
      fig = fig.tight_layout()
      # Reset multiplicative axes labels after tight_layout adjustment
      for ax in multiplicative_axes:
          ax = set_y_as_percent(ax)
      return fig
  
file_path: neural_prophet/neuralprophet/plot_forecast_matplotlib.py
imports: import logging
  import numpy
  from neuralprophet.plot_model_parameters_matplotlib import plot_custom_season, plot_daily, plot_weekly, plot_yearly
  from neuralprophet.plot_utils import set_y_as_percent
label_desc: Use image node_id 2 for calling a global function with example usage: plot_components(m, fcst, plot_configuration, df_name, quantile, one_period_per_season, figsize) and returns: fig