Usage from Python
Install the pluot Python package from PyPI.
pip install "pluot[bindings,widget]"Widget-only installation
Section titled “Widget-only installation”Specify only the widget extra to omit the Rust bindings during installation.
pip install "pluot[widget]"Bindings-only installation
Section titled “Bindings-only installation”Specify only the bindings extra to omit the widget during installation.
pip install "pluot[bindings]"When to use widget-only or bindings-only installation?
-
The widget-only package is a lightweight pure Python package which renders interactive plots as notebook widgets via an exported Anywidget. The lack of Rust bindings can make installation easier in certain environments such as Pyodide, JupyterLite, and Marimo-WASM.
-
The Rust bindings package enables Python to render plots by directly calling the bound Rust functions. As the name suggests, the Rust bindings package is not pure Python, which may complicate installation in certain environments such as Pyodide, JupyterLite, and Marimo-WASM.
Zarr data
Section titled “Zarr data”Use Zarr data from zarr-python Store instances.
Static plotting
Section titled “Static plotting”Use the render_to_array and render_to_image functions to render static plots in raster format.
The former returns a Numpy array, while the latter returns a PIL.Image object.
When used in a Jupyter notebook, the returned PIL.Image object will be displayed as an image output of the notebook cell.
Async runtime
Section titled “Async runtime”Since the plotting function is async, it must be called from a Python async runtime.
Code executed in Jupyter notebooks is already running in an async runtime, so await render_to_image will "just work".
However, in other contexts, be careful to ensure render_to_image is await-ed within an async runtime.
For instance, to use within a REPL, run python -m asyncio.