code: def plot_trend_change(
      m,
      quantile,
      ax=None,
      plot_name="Trend Change",
      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 isinstance(df_name, list):
          df_name = df_name[0]
      data_params = m.config_normalization.get_data_params(df_name)
      start = data_params["ds"].shift
      scale = data_params["ds"].scale
      time_span_seconds = scale.total_seconds()
      cp_t = []
      for cp in m.model.config_trend.changepoints:
          cp_t.append(
              start + datetime.timedelta(seconds=cp * time_span_seconds)
          )
      # Global/Local Mode
      if m.model.config_trend.trend_global_local == "local":
          quantile_index = m.model.quantiles.index(quantile)
          weights = m.model.trend.get_trend_deltas.detach()[
              quantile_index, m.model.id_dict[df_name], :
          ].numpy()
      else:
          quantile_index = m.model.quantiles.index(quantile)
          weights = m.model.trend.get_trend_deltas.detach()[
              quantile_index, 0, :
          ].numpy()
      # add end-point to force scale to match trend plot
      cp_t.append(start + scale)
      weights = np.append(weights, [0.0])
      width = time_span_seconds / 175000 / m.config_trend.n_changepoints
      artists += ax.bar(cp_t, weights, width=width, color="#0072B2")
      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("Trend Segment")
      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 2 for calling a global function with example usage: plot_trend_change(m, quantile, ax, plot_name, figsize, df_name) and returns: artists