code: def plot(
      fcst,
      quantiles,
      xlabel="ds",
      ylabel="y",
      highlight_forecast=None,
      line_per_origin=False,
      figsize=(700, 210),
      resampler_active=False,
      plotly_static=False,
  ):
      """
      Plot the NeuralProphet forecast
  
      Parameters
      ---------
          fcst : pd.DataFrame
              Output of m.predict
          quantiles: list
              Quantiles for which the forecasts are to be plotted.
          xlabel : str
              Label name on X-axis
          ylabel : str
              Label name on Y-axis
          highlight_forecast : int
              i-th step ahead forecast to highlight.
          line_per_origin : bool
              Print a line per forecast of one per forecast age
          figsize : tuple
              Width, height in inches.
          resampler_active : bool
              Flag whether to activate the plotly-resampler
          plotly_static: bool
              Flag whether to generate a static svg image
  
      Returns
      -------
          Plotly figure
      """
      if resampler_active:
          register_plotly_resampler(mode="auto")
      else:
          unregister_plotly_resampler()
  
      cross_marker_color = "blue"
      cross_symbol = "x"
  
      fcst = fcst.fillna(value=np.nan)
  
      ds = fcst["ds"].dt.to_pydatetime()
      colname = "yhat"
      step = 1
      # if plot_latest_forecast(), column names become "origin-x", with origin-0 being the latest forecast
      if line_per_origin:
          colname = "origin-"
          step = 0
      # all yhat column names
      yhat_col_names = [
          col_name
          for col_name in fcst.columns
          if col_name.startswith(colname) and "%" not in col_name
      ]
      data = []
  
      if highlight_forecast is None or line_per_origin:
          for i, yhat_col_name in enumerate(yhat_col_names):
              data.append(
                  go.Scatter(
                      name=yhat_col_name,
                      x=ds,
                      y=fcst[
                          f"{colname}{i if line_per_origin else i + 1}"
                      ],
                      mode="lines",
                      line=dict(
                          color=f"rgba(45, 146, 255, {0.2 + 2.0 / (i + 2.5)})",
                          width=line_width,
                      ),
                      fill="none",
                  )
              )
      if len(quantiles) > 1:
          for i in range(1, len(quantiles)):
              # skip fill="tonexty" for the first quantile
              quantiles_rounded = round(quantiles[i] * 100, 1)
              if i == 1:
                  data.append(
                      go.Scatter(
                          name=f"{colname}{highlight_forecast if highlight_forecast else step} {quantiles_rounded}%",
                          x=ds,
                          y=fcst[
                              f"{colname}{highlight_forecast if highlight_forecast else step} {quantiles_rounded}%"
                          ],
                          mode="lines",
                          line=dict(
                              color="rgba(45, 146, 255, 0.2)", width=1
                          ),
                          fillcolor="rgba(45, 146, 255, 0.2)",
                      )
                  )
              else:
                  data.append(
                      go.Scatter(
                          name=f"{colname}{highlight_forecast if highlight_forecast else step} {quantiles_rounded}%",
                          x=ds,
                          y=fcst[
                              f"{colname}{highlight_forecast if highlight_forecast else step} {quantiles_rounded}%"
                          ],
                          mode="lines",
                          line=dict(
                              color="rgba(45, 146, 255, 0.2)", width=1
                          ),
                          fill="tonexty",
                          fillcolor="rgba(45, 146, 255, 0.2)",
                      )
                  )
  
      if highlight_forecast is not None:
          if line_per_origin:
              num_forecast_steps = sum(fcst["origin-0"].notna())
              steps_from_last = num_forecast_steps - highlight_forecast
              for i, yhat_col_name in enumerate(yhat_col_names):
                  x = [ds[-(1 + i + steps_from_last)]]
                  y = [
                      fcst[f"origin-{i}"].values[
                          -(1 + i + steps_from_last)
                      ]
                  ]
                  data.append(
                      go.Scatter(
                          name=yhat_col_name,
                          x=x,
                          y=y,
                          mode="markers",
                          marker=dict(
                              color=cross_marker_color,
                              size=marker_size,
                              symbol=cross_symbol,
                          ),
                      )
                  )
          else:
              x = ds
              y = fcst[f"yhat{highlight_forecast}"]
              data.append(
                  go.Scatter(
                      name="Predicted",
                      x=x,
                      y=y,
                      mode="lines",
                      line=dict(
                          color=prediction_color, width=line_width
                      ),
                  )
              )
              data.append(
                  go.Scatter(
                      name="Predicted",
                      x=x,
                      y=y,
                      mode="markers",
                      marker=dict(
                          color=cross_marker_color,
                          size=marker_size,
                          symbol=cross_symbol,
                      ),
                  )
              )
  
      # Add actual
      data.append(
          go.Scatter(
              name="Actual",
              x=ds,
              y=fcst["y"],
              marker=dict(color=actual_color, size=marker_size),
              mode="markers",
          )
      )
  
      # Plot trend
      # if trend:
      #    data.append(
      #        go.Scatter(
      #            name="Trend",
      #            x=fcst["ds"],
      #            y=fcst["trend"],
      #            mode="lines",
      #            line=dict(color=trend_color, width=line_width),
      #        )
      #    )
  
      layout = go.Layout(
          showlegend=True,
          width=figsize[0],
          height=figsize[1],
          xaxis=go.layout.XAxis(
              title=xlabel,
              type="date",
              rangeselector=dict(
                  buttons=list(
                      [
                          dict(
                              count=7,
                              label="1w",
                              step="day",
                              stepmode="backward",
                          ),
                          dict(
                              count=1,
                              label="1m",
                              step="month",
                              stepmode="backward",
                          ),
                          dict(
                              count=6,
                              label="6m",
                              step="month",
                              stepmode="backward",
                          ),
                          dict(
                              count=1,
                              label="1y",
                              step="year",
                              stepmode="backward",
                          ),
                          dict(step="all"),
                      ]
                  )
              ),
              rangeslider=dict(visible=True),
              **xaxis_args,
          ),
          yaxis=go.layout.YAxis(title=ylabel, **yaxis_args),
          **layout_args,
      )
      fig = go.Figure(data=data, layout=layout)
      unregister_plotly_resampler()
      if plotly_static:
          fig = fig.show("svg")
      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 1 for calling a global function with example usage: plot(fcst, quantiles, xlabel, ylabel, highlight_forecast, line_per_origin, figsize, resampler_active, plotly_static) and returns: fig