code: def test_chart_mpl_update(pl):
      import matplotlib.pyplot as plt
  
      # Create simple chart
      x0, y0, y1 = [0, 1, 2], [2, 1, 3], [-1, 0, 2]
      f, ax = plt.subplots()
      line = ax.plot(x0, y0)[0]
      chart = pv.ChartMPL(f, redraw_on_render=False)
      pl.add_chart(chart)
      pl_changed = PlotterChanged(pl)
  
      # Update matplotlib figure without redraw_on_update
      line.set_ydata(y1)
      # No changes when pl.render() is called (as redraw_on_render is False)
      pl.render()
      assert not pl_changed()
      # Changes when figure is explicitly redrawn:
      f.canvas.draw()
      assert pl_changed()
  
      # Update matplotlib figure with redraw_on_render
      chart.redraw_on_render = True
      line.set_ydata(y0)
      # Changes when pl.render() is called (as redraw_on_render is True now)
      pl.render()
      assert pl_changed()
  
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 46 for calling a global function with example usage: test_chart_mpl_update(pl) without return types