code: def plot_alignment(
      self,
      new_plot: bool = False,
      series1_y_offset: float = 0,
      series2_y_offset: float = 0,
      components: Union[Tuple[Union[str, int], Union[str, int]]] = (
          0,
          0,
      ),
      args_line: dict = {},
      args_series1: dict = {},
      args_series2: dict = {},
  ):
      """
      Plots the uni-variate component of each series,
      with lines between them indicating the alignment selected by the DTW algorithm.
  
      Parameters
      ----------
      new_plot
          whether to spawn a new Figure
      series2_y_offset
          offset series1 vertically for ease of viewing.
      series1_y_offset
          offset series2 vertically for ease of viewing.
      components
          Tuple of component index for series1 and component index for series2.
      args_line
          Some keywords arguments to pass to `plot()` method for line
      args_series1
          Some keyword arguments to pass to `plot()` method for series1
      args_series2
          Some keyword arguments to pass to `plot()` method for series2
      """
  
      series1 = self.series1
      series2 = self.series2
  
      (component1, component2) = components
  
      if not series1.is_univariate:
          series1 = series1.univariate_component(component1)
      if not series2.is_univariate:
          series2 = series2.univariate_component(component2)
  
      series1 += series1_y_offset
      series2 += series2_y_offset
  
      xa1 = series1.data_array(copy=False)
      xa2 = series2.data_array(copy=False)
  
      path = self.path()
      n = len(path)
  
      time_dim1 = series1.time_dim
      time_dim2 = series2.time_dim
  
      x_coords1 = np.array(xa1[time_dim1], dtype=xa1[time_dim1].dtype)[
          path[:, 0]
      ]
      x_coords2 = np.array(xa2[time_dim2], dtype=xa2[time_dim2].dtype)[
          path[:, 1]
      ]
  
      y_coords1 = series1.univariate_values()[path[:, 0]]
      y_coords2 = series2.univariate_values()[path[:, 1]]
  
      if series1.has_datetime_index:
          x_dtype = xa1[time_dim1].dtype
          x_nan = np.datetime64("NaT")
      else:
          x_dtype = np.float64
          x_nan = np.nan
  
      x_coords = np.empty(n * 3, dtype=x_dtype)
      y_coords = np.empty(n * 3, dtype=np.float64)
  
      x_coords[0::3] = x_coords1
      x_coords[1::3] = x_coords2
      x_coords[2::3] = x_nan
  
      y_coords[0::3] = y_coords1
      y_coords[1::3] = y_coords2
      y_coords[2::3] = np.nan
  
      arr = xr.DataArray(
          y_coords, dims=["value"], coords={"value": x_coords}
      )
      xr.plot.line(arr, x="value", **args_line)
  
      series1.plot(**args_series1)
      series2.plot(**args_series2)
  
imports: from typing import Tuple, Union
  import numpy
  import xarray
  from matplotlib import pyplot
label_desc: Use image node_id 2 for calling a global function with example usage: plot_alignment(new_plot, series1_y_offset, series2_y_offset, components, args_line, args_series1, args_series2) without return types