code: def plot_paired_histogram(
      histogram_data: List[List[float]],
      title: Text,
      output_file: Optional[Text] = None,
      num_bins: int = 25,
      colors: Tuple[Text, Text] = (
          "#009292",
          "#920000",
      ),  # (dark cyan, dark red)
      axes_label: Tuple[Text, Text] = ("Correct", "Wrong"),
      frame_label: Tuple[Text, Text] = (
          "Number of Samples",
          "Confidence",
      ),
      density: bool = False,
      x_pad_fraction: float = 0.05,
      y_pad_fraction: float = 0.10,
  ) -> None:
      """Plots a side-by-side comparative histogram of the confidence distribution.
  
      Args:
          histogram_data: Two data vectors
          title: Title to be displayed above the plot
          output_file: File to save the plot to
          num_bins: Number of bins to be used for the histogram
          colors: Left and right bar colors as hex color strings
          axes_label: Labels shown above the left and right histogram,
              respectively
          frame_label: Labels shown below and on the left of the
              histogram, respectively
          density: If true, generate a probability density histogram
          x_pad_fraction: Percentage of extra space in the horizontal direction
          y_pad_fraction: Percentage of extra space in the vertical direction
      """
      if num_bins <= 2:
          rasa.shared.utils.io.raise_warning(
              f"Number {num_bins} of paired histogram bins must be at least 3."
          )
          return
  
      try:
          (
              bins,
              tallies,
              x_ranges,
              y_range,
          ) = _extract_paired_histogram_specification(
              histogram_data,
              num_bins,
              density=density,
              x_pad_fraction=x_pad_fraction,
              y_pad_fraction=y_pad_fraction,
          )
      except (ValueError, TypeError) as e:
          rasa.shared.utils.io.raise_warning(
              f"Unable to plot paired histogram '{title}': {e}"
          )
          return
      yticks = [float(f"{x:.2f}") for x in bins]
  
      import matplotlib.pyplot as plt
  
      plt.gcf().clear()
  
      fig, axes = plt.subplots(ncols=2, sharey=True)
      for side in range(2):
          axes[side].barh(
              bins[:-1],
              tallies[side],
              height=np.diff(bins),
              align="center",
              color=colors[side],
              linewidth=1,
              edgecolor="white",
          )
          axes[side].set(title=axes_label[side])
          axes[side].set(
              yticks=yticks, xlim=(0, x_ranges[side]), ylim=y_range
          )
  
      axes[0].yaxis.set_major_formatter(FormatStrFormatter("%.2f"))
      axes[0].yaxis.set_minor_formatter(FormatStrFormatter("%.2f"))
  
      axes[0].invert_xaxis()
      axes[0].yaxis.tick_right()
  
      # Add the title
      fig.suptitle(title, fontsize="x-large", fontweight="bold")
  
      # Add hidden plot to correctly add x and y labels (frame_label)
      fig.add_subplot(111, frameon=False)
  
      # Hide tick and tick label of the unused axis
      plt.tick_params(
          labelcolor="none",
          top=False,
          bottom=False,
          left=False,
          right=False,
      )
      plt.xlabel(frame_label[0])
      plt.ylabel(frame_label[1])
  
      if output_file:
          fig = plt.gcf()
          fig.set_size_inches(10, 10)
          fig.tight_layout(w_pad=0)
          fig.savefig(output_file, bbox_inches="tight")
  
file_path: rasa/rasa/utils/plotting.py
imports: import logging
  import itertools
  import os
  from functools import wraps
  import numpy
  from typing import Any, Callable, List, Optional, Text, TypeVar, Union, Tuple
  import matplotlib
  from matplotlib.ticker import FormatStrFormatter
  import rasa.shared.utils.io
  from rasa.constants import RESULTS_FILE
label_desc: Use image node_id 5 for calling a global function with example usage: plot_paired_histogram(histogram_data, title, output_file, num_bins, colors, axes_label, frame_label, density, x_pad_fraction, y_pad_fraction) without return types