code: def test_stackplot(chart_2d, stack_plot):
      x = [0, 1, 2]
      ys = [[1, 2, 3], [2, 1, 0], [1, 1, 1]]
      c = [
          (1.0, 0.0, 1.0, 1.0),
          (1.0, 1.0, 0.0, 1.0),
          (0.0, 1.0, 1.0, 1.0),
      ]
      l = ["Foo", "Spam", "Bla"]
  
      # Test multi comp constructor
      plot = charts.StackPlot(chart_2d, x, ys, c, l)
      assert plot._chart == weakref.proxy(chart_2d)
      assert np.allclose(plot.x, x)
      assert np.allclose(plot.ys, ys)
      assert all(pc == ci for pc, ci in zip(plot.colors, c))
      assert plot.labels == l
  
      # Test single comp constructor
      plot = charts.StackPlot(chart_2d, x, ys[0], c[0], l[0])
      assert plot._chart == weakref.proxy(chart_2d)
      assert np.allclose(plot.x, x)
      assert np.allclose(plot.ys, ys[0])
      assert plot.color == c[0]
      assert plot.label == l[0]
  
      # Test multi and single comp constructors with inconsistent arguments
      with pytest.raises(ValueError):
          charts.StackPlot(chart_2d, x, ys, c[0], l)
      # charts.StackPlot(chart_2d, x, ys, c, l[0])  # This one is valid
      with pytest.raises(ValueError):
          charts.StackPlot(chart_2d, x, ys[0], c, l[0])
      with pytest.raises(ValueError):
          charts.StackPlot(chart_2d, x, ys[0], c[0], l)
  
      # Test remaining properties
      stack_plot.update(x, ys)
      assert np.allclose(stack_plot.x, x)
      assert np.allclose(stack_plot.ys, ys)
  
imports: import itertools
  import platform
  import weakref
  import numpy
  import pytest
  from vtkmodules.vtkRenderingContext2D import vtkPen
  import pyvista
  from pyvista import examples
  from pyvista.plotting import charts
  from pyvista.plotting.colors import COLOR_SCHEMES
label_desc: Use image node_id 41 for calling a global function with example usage: test_stackplot(chart_2d, stack_plot) without return types