code: def plot_weekly(
      m,
      quantile,
      comp_name="weekly",
      weekly_start=0,
      quick=True,
      ax=None,
      figsize=(10, 6),
      df_name="__df__",
  ):
      """Plot the weekly component of the forecast.
  
      Parameters
      ----------
          m : NeuralProphet
              Fitted model
          quantile : float
              The quantile for which the weekly seasonality is plotted
          comp_name : str
              Name of seasonality component
          weekly_start : int
              Specifying the start day of the weekly seasonality plot
  
              Options
                  * (default) ``weekly_start = 0``: starts the week on Sunday
                  * ``weekly_start = 1``: shifts by 1 day to Monday, and so on
          quick : bool
              Use quick low-level call of model
          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)``
          df_name : str
              Name of dataframe to refer to data params from original keys of train dataframes
  
              Note
              ----
              Only used for local normalization in global modeling
  
      Returns
      -------
          matplotlib.artist.Artist
              List of Artist objects containing weekly forecast component
  
      """
      artists = []
      if not ax:
          fig = plt.figure(facecolor="w", figsize=figsize)
          ax = fig.add_subplot(111)
      week_days = 7
      if m.data_freq == "B":
          week_days = 5
          weekly_start = 1
      days_i = pd.date_range(
          start="2017-01-01", periods=week_days * 24, freq="H"
      ) + pd.Timedelta(days=weekly_start)
      df_w = pd.DataFrame({"ds": days_i})
      if not isinstance(df_name, list):
          df_w["ID"] = df_name
      mean_std = False  # Indicates whether mean and quant of global df shall be plotted
      if isinstance(df_name, list):
          df_w = pd.DataFrame()
          mean_std = True
          quick = False
          for i in range(m.id_list.__len__()):
              df_i = pd.DataFrame({"ds": days_i})
              df_i["ID"] = m.id_list[i]
              df_w = pd.concat((df_w, df_i), ignore_index=True)
      if quick:
          predicted = predict_season_from_dates(
              m,
              dates=df_w["ds"],
              name=comp_name,
              quantile=quantile,
              df_name=df_name,
          )
      else:
          predicted = m.predict_seasonal_components(
              df_w, quantile=quantile
          )[["ds", "ID", comp_name]]
      days = pd.date_range(
          start="2017-01-01", periods=week_days
      ) + pd.Timedelta(days=weekly_start)
  
      if mean_std:
          # If more than on ID has been provided, and no df_name has been specified: plot median and quants across all IDs
          predicted_q90 = predicted.groupby("ds")[[comp_name]].apply(
              lambda x: x.quantile(0.9)
          )
          predicted_q10 = predicted.groupby("ds")[[comp_name]].apply(
              lambda x: x.quantile(0.1)
          )
          predicted = predicted.groupby("ds")[[comp_name]].apply(
              lambda x: x.mean()
          )
          predicted["ID"] = m.id_list[0]
          df_w = df_w[df_w["ID"] == m.id_list[0]]
  
      days = pd.date_range(
          start="2017-01-01", periods=7
      ) + pd.Timedelta(days=weekly_start)
      days = days.day_name()
      artists += ax.plot(
          range(len(days_i)),
          predicted[comp_name],
          ls="-",
          c="#0072B2",
          label=comp_name + " Mean" if mean_std else None,
      )
      ax.grid(True, which="major", c="gray", ls="-", lw=1, alpha=0.2)
      if mean_std:
          ax.fill_between(
              range(len(days_i)),
              predicted_q10[comp_name],
              predicted_q90[comp_name],
              alpha=0.2,
              label="Quants 10-90%",
              color="#0072B2",
          )
          ax.legend()
      ax.set_xticks(24 * np.arange(len(days) + 1 - weekly_start))
      ax.set_xticklabels(
          list(days) + [days[0]] if m.data_freq != "B" else list(days)
      )
      ax.set_xlabel("Day of week")
      ax.set_ylabel(f"Seasonality: {comp_name}")
      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 8 for calling a global function with example usage: plot_weekly(m, quantile, comp_name, weekly_start, quick, ax, figsize, df_name) and returns: artists