Image.interactive#

InteractiveManager.interactive(varx: dict[str, ndarray[tuple[Any, ...], dtype[Any]]] | ndarray[tuple[Any, ...], dtype[Any]], vary: dict[str, ndarray[tuple[Any, ...], dtype[Any]]] | None = None, check: bool = True, limfix: bool = True, labslider: list[str | float] | None = None, **kwargs: Any) None[source]#

Create an interactive plot with a slider to change the data.

Warning: it works only with the fluid variables.

Parameters:
- varx (not optional): array_like

The x-axis variable.

- vary: array_like, default None

The y-axis variable.

- ax: Axes, default None

The axes instance.

- labslider: str, default None

The label of the slider.

- limfix: bool, default True

If True, the colorbar limits are fixed through the entire animation.

- **kwargs: Any

Other parameters to pass used in the plot or display functions.

- vmin: float, default None

The minimum value of the data.

- vmax: float, default None

The maximum value of the data.

—-
Returns:
  • None

Examples

  • Example #1: Create an interactive 2D plot

    >>> import pyPLUTO as pp
    >>> D = pp.Load("all")
    >>> I = pp.Image()
    >>> I.interactive(
    ...     D.rho, x1=D.x1, x2=D.x2, cpos="right", vmin=0, vmax=1.0
    ... )
    >>> pp.show()
    
  • Example #2: Create an interactive 1D plot with a composite variable

    >>> import pyPLUTO as pp
    >>> import numpy as np
    >>> D = pp.Load("all")
    >>> pp.Image().interactive(D.x1, np.sqrt(D.vx1**2 + D.vx2**2))
    >>> pp.show()