code: def plot_trend(
      m,
      quantile,
      ax=None,
      plot_name="Trend",
      figsize=(10, 6),
      df_name="__df__",
  ):
      """Make a barplot of the magnitudes of trend-changes.
  
      Parameters
      ----------
          m : NeuralProphet
              Fitted model
          quantile : float
              The quantile for which the trend changes are plotted
          ax : matplotlib axis
              Matplotlib Axes to plot on
          plot_name : str
              Name of the plot Title
          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 barplot
      """
      artists = []
      if not ax:
          fig = plt.figure(facecolor="w", figsize=figsize)
          ax = fig.add_subplot(111)
      if m.config_trend.n_changepoints == 0:
          if isinstance(df_name, list):
              df_name = df_name[0]
          data_params = m.config_normalization.get_data_params(df_name)
          t_start = data_params["ds"].shift
          t_end = t_start + data_params["ds"].scale
          quantile_index = m.model.quantiles.index(quantile)
  
          fcst_t = pd.Series([t_start, t_end]).dt.to_pydatetime()
          trend_0 = (
              m.model.trend.bias[quantile_index]
              .detach()
              .numpy()
              .squeeze()
          )
          if m.config_trend.growth == "off":
              trend_1 = trend_0
          else:
              if m.model.config_trend.trend_global_local == "local":
                  trend_1 = (
                      trend_0
                      + m.model.trend.trend_k0[
                          quantile_index, m.model.id_dict[df_name]
                      ]
                      .detach()
                      .numpy()
                      .squeeze()
                  )
              else:
                  trend_1 = (
                      trend_0
                      + m.model.trend.trend_k0[quantile_index, 0]
                      .detach()
                      .numpy()
                      .squeeze()
                  )
  
          data_params = m.config_normalization.get_data_params(df_name)
          shift = data_params["y"].shift
          scale = data_params["y"].scale
          trend_0 = trend_0 * scale + shift
          trend_1 = trend_1 * scale + shift
          artists += ax.plot(
              fcst_t, [trend_0, trend_1], ls="-", c="#0072B2"
          )
      else:
          mean_std = True
          if not isinstance(df_name, list):
              df_name = [df_name]
              # if global df with no specified df_name: plot mean and std, otherwise: don't
              mean_std = False
          df_y = pd.DataFrame()
          for df_name_i in df_name:
              data_params = m.config_normalization.get_data_params(
                  df_name_i
              )
              t_start = data_params["ds"].shift
              t_end = t_start + data_params["ds"].scale
              quantile_index = m.model.quantiles.index(quantile)
  
              days = pd.date_range(
                  start=t_start, end=t_end, freq=m.data_freq
              )
              df_i = pd.DataFrame({"ds": days})
              df_i["ID"] = df_name_i
              df_y = pd.concat((df_y, df_i), ignore_index=True)
  
          df_trend = m.predict_trend(df=df_y, quantile=quantile)
  
          if mean_std:
              df_trend_q90 = df_trend.groupby("ds")[["trend"]].apply(
                  lambda x: x.quantile(0.9)
              )
              df_trend_q10 = df_trend.groupby("ds")[["trend"]].apply(
                  lambda x: x.quantile(0.1)
              )
              df_trend = df_trend.groupby("ds")[["trend"]].apply(
                  lambda x: x.mean()
              )
              df_trend["ID"] = m.id_list[0]
              df_y = df_y[df_y["ID"] == m.id_list[0]]
  
          artists += ax.plot(
              df_y["ds"],
              df_trend["trend"],
              ls="-",
              c="#0072B2",
              label="Mean" if mean_std else None,
          )
          if mean_std:
              ax.fill_between(
                  df_y["ds"].dt.to_pydatetime(),
                  df_trend_q10["trend"],
                  df_trend_q90["trend"],
                  alpha=0.2,
                  color="#0072B2",
                  label="Quants 10-90%",
              )
              ax.legend()
      # Specify formatting to workaround matplotlib issue #12925
      locator = AutoDateLocator(interval_multiples=False)
      formatter = AutoDateFormatter(locator)
      ax.xaxis.set_major_locator(locator)
      ax.xaxis.set_major_formatter(formatter)
      ax.grid(True, which="major", c="gray", ls="-", lw=1, alpha=0.2)
      ax.set_xlabel("ds")
      ax.set_ylabel(plot_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 3 for calling a global function with example usage: plot_trend(m, quantile, ax, plot_name, figsize, df_name) and returns: artists