code: def plot_interval_width_per_timestep(
      q_hats, method, resampler_active=False
  ):
      """Plot the nonconformity scores as well as the one-sided interval width (q).
  
      Parameters
      ----------
          q_hats : dataframe
              prediction interval widths (or q) for each timestep
          method : str
              name of conformal prediction technique used
  
              Options
                  * (default) ``naive``: Naive or Absolute Residual
                  * ``cqr``: Conformalized Quantile Regression
          resampler_active : bool
              Flag whether to activate the plotly-resampler
  
      Returns
      -------
          plotly.graph_objects.Figure
              Figure showing the q-values for each timestep
      """
      if resampler_active:
          register_plotly_resampler(mode="auto")
      else:
          unregister_plotly_resampler()
      # check if q_hats contains q_hat_sym
      if "q_hat_sym" in q_hats.columns:
          q_hats_sym = q_hats["q_hat_sym"]
          timestep_numbers = list(range(1, len(q_hats_sym) + 1))
          fig = px.line(
              pd.DataFrame(
                  {
                      "Timestep Number": timestep_numbers,
                      "One-Sided Interval Width": q_hats_sym,
                  }
              ),
              x="Timestep Number",
              y="One-Sided Interval Width",
              title=f"{method} One-Sided Interval Width with q per Timestep",
              width=600,
              height=400,
          )
      else:
          q_hats_lo = q_hats["q_hat_lo"]
          q_hats_hi = q_hats["q_hat_hi"]
          timestep_numbers = list(range(1, len(q_hats_lo) + 1))
          fig = px.line(
              pd.DataFrame(
                  {
                      "Timestep Number": timestep_numbers,
                      "One-Sided Lower Interval Width": q_hats_lo,
                      "One-Sided Upper Interval Width": q_hats_hi,
                  }
              ),
              x="Timestep Number",
              y=[
                  "One-Sided Lower Interval Width",
                  "One-Sided Upper Interval Width",
              ],
              title=f"{method} One-Sided Interval Width with q per Timestep",
              width=600,
              height=400,
          )
      fig.update_layout(margin=dict(l=70, r=70, t=60, b=50))
      unregister_plotly_resampler()
      return fig
  
file_path: neural_prophet/neuralprophet/plot_forecast_plotly.py
imports: import logging
  import numpy
  import pandas
  from neuralprophet.plot_model_parameters_plotly import get_dynamic_axis_range
  from neuralprophet.plot_utils import set_y_as_percent
label_desc: Use image node_id 7 for calling a global function with example usage: plot_interval_width_per_timestep(q_hats, method, resampler_active) and returns: fig