code: def plot_prediction_distribution(
      bootstrapping_predictions: pd.DataFrame,
      bw_method: Optional[Any] = None,
      **fig_kw,
  ) -> matplotlib.figure.Figure:
      """
      Ridge plot of bootstrapping predictions. This plot is very useful to understand
      the uncertainty of forecasting predictions.
  
      Parameters
      ----------
      bootstrapping_predictions : pandas DataFrame
          Bootstrapping predictions created with `Forecaster.predict_bootstrapping`.
      bw_method : str, scalar, Callable, default `None`
          The method used to calculate the estimator bandwidth. This can be 'scott',
          'silverman', a scalar constant or a Callable. If None (default), 'scott'
          is used. See scipy.stats.gaussian_kde for more information.
      fig_kw : dict
          All additional keyword arguments are passed to the `pyplot.figure` call.
  
      Returns
      -------
      fig : matplotlib.figure.Figure
          Matplotlib Figure.
  
      """
  
      index = bootstrapping_predictions.index.astype(str).to_list()[
          ::-1
      ]
      palette = sns.cubehelix_palette(
          len(index), rot=-0.25, light=0.7, reverse=False
      )
      fig, axs = plt.subplots(len(index), 1, sharex=True, **fig_kw)
      if not isinstance(axs, np.ndarray):
          axs = np.array([axs])
  
      for i, step in enumerate(index):
          plot = bootstrapping_predictions.loc[step, :].plot.kde(
              ax=axs[i], bw_method=bw_method, lw=0.5
          )
  
          # Fill density area
          x = plot.get_children()[0]._x
          y = plot.get_children()[0]._y
          axs[i].fill_between(x, y, color=palette[i])
          prediction_mean = bootstrapping_predictions.loc[
              step, :
          ].mean()
  
          # Closest point on x to the prediction mean
          idx = np.abs(x - prediction_mean).argmin()
          axs[i].vlines(
              x[idx], ymin=0, ymax=y[idx], linestyle="dashed", color="w"
          )
  
          axs[i].spines["top"].set_visible(False)
          axs[i].spines["right"].set_visible(False)
          axs[i].spines["bottom"].set_visible(False)
          axs[i].spines["left"].set_visible(False)
          axs[i].set_yticklabels([])
          axs[i].set_yticks([])
          axs[i].set_ylabel(step, rotation="horizontal")
          axs[i].set_xlabel("prediction")
  
      fig.subplots_adjust(hspace=-0)
      fig.suptitle("Forecasting distribution per step")
  
      return fig
  
file_path: skforecast/skforecast/plot/plot.py
imports: from typing import Union, Any, Optional
  import numpy
  import pandas
  from ..utils import check_optional_dependency
label_desc: Use image node_id 3 for calling a global function with example usage: plot_prediction_distribution(bootstrapping_predictions, bw_method) and returns: fig