code: def plot_cumulative(
      cmaps: List[str],
      data_struct: Dict[str, pd.DataFrame],
      models: List[str],
      uncertainty_types: List[Tuple[str, str]],
      bins: Union[List[int], np.ndarray],
      title: str,
      compare_to_all: bool = False,
      save_path: Optional[str] = None,
      error_scaling_factor: float = 1,
  ) -> None:
      """
      Plots cumulative errors.
  
      Args:
          cmaps: A list of colors for matplotlib.
          data_struct: A dictionary containing the dataframes for each model.
          models: A list of models we want to compare, keys in `data_struct`.
          uncertainty_types: A list of lists describing the different uncertainty combinations to test.
          bins: A list of bins to show error form.
          title: The title of the plot.
          compare_to_all: Whether to compare the given subset of bins to all the data (default=False).
          save_path: The path to save plot to. If None, displays on screen (default=None).
          error_scaling_factor (float, optional): Scaling factor for error. Defaults to 1.0.
      """
  
      # make sure bins is a list and not a single value
      bins = (
          [bins] if not isinstance(bins, (list, np.ndarray)) else bins
      )
  
      plt.style.use("ggplot")
  
      _ = plt.figure()
  
      ax = plt.gca()
      plt.xticks(fontsize=10)
      plt.yticks(fontsize=10)
  
      ax.set_xlabel("Error (mm)", fontsize=10)
      ax.set_ylabel("Number of images in %", fontsize=10)
      plt.title(title)
  
      ax.set_xscale("log")
      line_styles = [":", "-", "dotted", "-."]
      for i, (uncert_pair) in enumerate(uncertainty_types):
          uncertainty = (uncert_pair)[0]
          color = cmaps[i]
          for hash_idx, model_type in enumerate(models):
              line = line_styles[hash_idx]
  
              # Filter only the bins selected
              dataframe = data_struct[model_type]
              model_un_errors = (
                  dataframe[
                      dataframe[uncertainty + " Uncertainty bins"].isin(
                          bins
                      )
                  ][uncertainty + " Error"].values
                  * error_scaling_factor
              )
  
              p = (
                  100
                  * np.arange(len(model_un_errors))
                  / (len(model_un_errors) - 1)
              )
  
              sorted_errors = np.sort(model_un_errors)
  
              ax.plot(
                  sorted_errors,
                  p,
                  label=model_type + " " + uncertainty,
                  color=color,
                  linestyle=line,
                  dash_capstyle="round",
              )
  
              if compare_to_all:
                  dataframe = data_struct[model_type]
                  model_un_errors = (
                      dataframe[uncertainty + " Error"].values
                      * error_scaling_factor
                  )
  
                  p = (
                      100
                      * np.arange(len(model_un_errors))
                      / (len(model_un_errors) - 1)
                  )
  
                  sorted_errors = np.sort(model_un_errors)
                  line = line_styles[len(models) + hash_idx]
                  ax.plot(
                      sorted_errors,
                      p,
                      label=model_type + " " + uncertainty,
                      color=color,
                      linestyle=line,
                      dash_capstyle="round",
                  )
  
      handles, labels = ax.get_legend_handles_labels()
      ax.legend(handles, labels, prop={"size": 10})
      plt.axvline(x=5, color=cmaps[3])
  
      for axis in [ax.xaxis, ax.yaxis]:
          axis.set_major_formatter(ScalarFormatter())
  
      plt.xticks([1, 2, 3, 4, 5, 10, 20, 30])
  
      ax.xaxis.label.set_color("black")
      ax.yaxis.label.set_color("black")
  
      ax.tick_params(axis="x", colors="black")
      ax.tick_params(axis="y", colors="black")
  
      if save_path is not None:
          plt.savefig(
              save_path + "cumulative_error.pdf",
              dpi=100,
              bbox_inches="tight",
              pad_inches=0.2,
          )
          plt.close()
      else:
          plt.gcf().set_size_inches(16.0, 10.0)
          plt.show()
          plt.close()
  
imports: import logging
  import math
  import os
  from typing import Any, Dict, List, Optional, Tuple, Union
  import matplotlib.lines
  import matplotlib.patches
  import matplotlib.pyplot
  import matplotlib.ticker
  import numpy
  import pandas
  import pwlf
  from matplotlib.ticker import ScalarFormatter
  from scipy import stats
  from sklearn.isotonic import IsotonicRegression
  from kale.evaluate.similarity_metrics import evaluate_correlations
  from kale.evaluate.uncertainty_metrics import evaluate_bounds, evaluate_jaccard, get_mean_errors
  from kale.prepdata.tabular_transform import generate_struct_for_qbin
  from kale.utils.save_xlsx import generate_summary_df
label_desc: Use image node_id 7 for calling a global function with example usage: plot_cumulative(cmaps, data_struct, models, uncertainty_types, bins, title, compare_to_all, save_path, error_scaling_factor) without return types