code: def _plot_series(series, ax_id, linewidth, label_name, **kwargs):
      """Internal function called by ``show_anomalies_from_scores()``
  
      Plot the series on the given axes ax_id.
  
      Parameters
      ----------
      series
          The series to plot.
      ax_id
          The axis the series will be ploted on.
      linewidth
          Thickness of the line.
      label_name
          Name that will appear in the legend.
      """
  
      for i, c in enumerate(series._xa.component[:10]):
          comp = series._xa.sel(component=c)
  
          if comp.sample.size > 1:
              central_series = comp.mean(dim="sample")
              low_series = comp.quantile(q=0.05, dim="sample")
              high_series = comp.quantile(q=0.95, dim="sample")
          else:
              central_series = comp
  
          label_to_use = (
              (
                  label_name
                  + ("_" + str(i) if len(series.components) > 1 else "")
              )
              if label_name != ""
              else "" + str(str(c.values))
          )
  
          central_series.plot(
              ax=ax_id,
              linewidth=linewidth,
              label=label_to_use,
              **kwargs,
          )
  
          if comp.sample.size > 1:
              ax_id.fill_between(
                  series.time_index,
                  low_series,
                  high_series,
                  alpha=0.25,
                  **kwargs,
              )
  
file_path: darts/darts/ad/utils.py
imports: from typing import Sequence, Tuple, Union
  import matplotlib.pyplot
  import numpy
  from sklearn.metrics import accuracy_score, average_precision_score, f1_score, precision_score, recall_score, roc_auc_score
  from darts import TimeSeries
  from darts.logging import get_logger, raise_if, raise_if_not
label_desc: Use image node_id 12 for calling a global function with example usage: _plot_series(series, ax_id, linewidth, label_name) without return types