code: def default_history_repartition_image_creator(
      label2counts: Dict[int, List[int]],
      counters: List[int],
      colors: Union[ndarray, Iterable, int, float] = SEABORN_COLORS,
  ):
      """
      Create a stack plot representing the labels repartition with their history.
  
      :param label2counts: A dict holding the counts for each label, of the form
          {label: [count_at_step_0, count_at_step_1, ...]}.
      :param counters: The steps the counts were taken at.
      :param colors: The colors to use in the chart.
      """
      ax: Axes
      fig, ax = plt.subplots()
  
      ax.stackplot(
          counters,
          label2counts.values(),
          labels=label2counts.keys(),
          colors=colors,
      )
      ax.legend(loc="upper left")
      ax.set_ylabel("Number of examples")
      ax.set_xlabel("step")
  
      fig.tight_layout()
      return fig
  
file_path: avalanche/avalanche/evaluation/metric_utils.py
imports: from typing import Dict, Optional, Union, Iterable, Sequence, Tuple, TYPE_CHECKING, List, Callable, Any
  import matplotlib.pyplot
  import numpy
  from matplotlib.axes import Axes
  from numpy import ndarray, arange
  from torch import Tensor
label_desc: Use image node_id 4 for calling a global function with example usage: default_history_repartition_image_creator(label2counts, counters, colors) and returns: fig