code: import numpy as np
  import matplotlib.pyplot as plt
  
  from ctsutils.cparameterspace import CParam, CParameterSpace
  
  
  def foo(X, Y, Y2):
      """ """
      return (1 - X / 2 + X ** 5 + (Y + Y2 ) ** 3) * np.exp(-X ** 2 - (Y + Y2 ) ** 2)  # calcul du tableau des valeurs de Z
  
  
  def foo(X, Y, Y2, Y3):
      """ """
      return (1 - X / 2 + X ** 5 + (Y + Y2 + Y3) ** 3) * np.exp(-X ** 2 - (Y + Y2 + Y3) ** 2)  # calcul du tableau des valeurs de Z
  
  
  ps = CParameterSpace([CParam("x", np.linspace(-3, 3, 51), unit="m"),
                        CParam("y", np.linspace(-2, 2, 41)),
                        CParam("y2", np.linspace(-1, 1, 31)),
                        CParam("y3", np.linspace(-1, 1, 10))])
  
  # import pdb; pdb.set_trace()  # noqa BREAKPOINT
  # x = ps.get_arr("x")
  
  Z = ps.calc_function(foo, args_param_names=("x", "y", "y2", "y3"))
  
  integrals = ps.calc_integral(Z, "x")
  # import pdb; pdb.set_trace()  # noqa BREAKPOINT
  
  # fig, ax = plt.subplots(1, 1)
  # ps.plot(Z, ordering_of_params_names=("y2", "y"), ax=ax)
  # plt.show()
  
  # import pdb; pdb.set_trace()  # noqa BREAKPOINT
  
  fig, ax = plt.subplots(1, 1)
  
  #ps.plot(Z, z_label="Z", ordering_of_params_name_and_value=(("y3", None), ("y2", None)), ax=ax)
  ps.plot(integrals, z_label="integrals", ordering_of_params_name_and_value=(("y3", None), ("y2", None)), ax=ax)
  
  # ps.plot(integrals, z_label="integrals", ordering_of_params_name_and_value=(("y2", None), ("y", None)), ax=ax)
  
  plt.show()
   import numpy as np
  import matplotlib.pyplot as plt
  from matplotlib.widgets import Slider, Button, RadioButtons
  
  fig, ax = plt.subplots()
  plt.subplots_adjust(left=0.25, bottom=0.25)
  t = np.arange(0.0, 1.0, 0.001)
  a0 = 5
  f0 = 3
  delta_f = 5.0
  s = a0 * np.sin(2 * np.pi * f0 * t)
  l, = plt.plot(t, s, lw=2)
  ax.margins(x=0)
  
  axcolor = 'lightgoldenrodyellow'
  axfreq = plt.axes([0.25, 0.1, 0.65, 0.03], facecolor=axcolor)
  axamp = plt.axes([0.25, 0.15, 0.65, 0.03], facecolor=axcolor)
  
  sfreq = Slider(axfreq, 'Freq', 0.1, 30.0, valinit=f0, valstep=delta_f)
  samp = Slider(axamp, 'Amp', 0.1, 10.0, valinit=a0)
  
  
  def update(val):
      print(val)
      amp = samp.val
      freq = sfreq.val
      l.set_ydata(amp*np.sin(2*np.pi*freq*t))
      fig.canvas.draw_idle()
  
  
  sfreq.on_changed(update)
  samp.on_changed(update)
  
  resetax = plt.axes([0.8, 0.025, 0.1, 0.04])
  button = Button(resetax, 'Reset', color=axcolor, hovercolor='0.975')
  
  
  def reset(event):
      sfreq.reset()
      samp.reset()
  button.on_clicked(reset)
  
  rax = plt.axes([0.025, 0.5, 0.15, 0.15], facecolor=axcolor)
  radio = RadioButtons(rax, ('red', 'blue', 'green'), active=0)
  
  
  def colorfunc(label):
      l.set_color(label)
      fig.canvas.draw_idle()
  radio.on_clicked(colorfunc)
  
  plt.show()
  
apis: numpy.exp matplotlib.pyplot.show numpy.linspace matplotlib.pyplot.subplots
apis: numpy.sin matplotlib.widgets.Button matplotlib.pyplot.subplots matplotlib.pyplot.axes numpy.arange matplotlib.widgets.RadioButtons matplotlib.pyplot.subplots_adjust matplotlib.pyplot.show matplotlib.pyplot.plot matplotlib.widgets.Slider