Skip to main content

ruviz for Python

ruviz for Python wraps the Rust plotting runtime with a fluent Python API, static export helpers, native desktop show(), and notebook widget support. It requires Python 3.10 or newer and installs the runtime dependencies needed for NumPy inputs, static rendering, and AnyWidget notebooks.

Install

pip install ruviz

If you want pandas or Polars dataframe inputs, install the matching optional extra:

pip install "ruviz[dataframes]"
# or only one dataframe backend:
pip install "ruviz[pandas]"
pip install "ruviz[polars]"

Quick Start

import numpy as np
import ruviz

x = np.linspace(0.0, 4.0, 50)
y = x**2

(
    ruviz.plot()
    .line(x, y)
    .title("Quadratic")
    .xlabel("x")
    .ylabel("y = x^2")
    .save("quadratic.png")
)

Notebook and Desktop Usage

  • In Jupyter, plot.show() displays a static PNG in the cell output.
  • Use plot.widget() when you want the synced WASM-backed notebook widget.
  • plot.size_px(width, height) also controls the widget's displayed size and aspect ratio.
  • Without size_px(...), the widget uses the default PNG size (640x480) and shrinks proportionally if the notebook column is narrower.
  • Drag the widget's bottom-right handle to resize the display freely.
  • Hold Shift or Ctrl while dragging the handle to preserve the current aspect ratio.
  • In the widget, right click opens the export menu and right drag performs box zoom.
  • Outside notebooks, plot.show() opens the native interactive window.
  • The published Linux wheel focuses on static rendering and notebook widgets. Install from source on Linux if you need the native desktop plot.show() window.
  • plot.render_png() returns PNG bytes and plot.render_svg() returns an SVG string.
  • plot.save(path) writes PNG, SVG, or PDF according to the file extension and returns the output Path.

Reactive Notebook Data

Use ruviz.observable(...) for notebook-driven updates that keep explicit widgets in sync:

import numpy as np
import ruviz

x = np.linspace(0.0, 6.0, 200)
y = ruviz.observable(np.sin(x))

plot = ruviz.plot().size_px(640, 360).line(x, y).title("Live Sine Wave")
widget = plot.widget()

ObservableSeries supports elementwise arithmetic and NumPy ufuncs. Derived observables stay live until you write to them directly. Live observable series are supported by line, scatter, bar, histogram, boxplot, error_bars, and error_bars_xy; other plot types snapshot their inputs.

import numpy as np

scaled = np.sin(y * 2.0 + 0.25)
plot.line(x, scaled)
y.replace(np.cos(x))

deepcopy(plot) creates an independent live copy with fresh observables, while plot.clone() remains a static snapshot copy.

Documentation

Contributor Workflow

cd python
uv sync
uv run maturin develop
uv run python scripts/generate_gallery.py
uv run mkdocs serve

Rebuild the bundled widget frontend from the repository root when you change the web SDK or packages/ruviz-web/src/python-widget.ts:

bun run build:python-widget

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ruviz-0.4.20.tar.gz (5.0 MB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

ruviz-0.4.20-cp310-abi3-win_amd64.whl (7.0 MB view details)

Uploaded CPython 3.10+Windows x86-64

ruviz-0.4.20-cp310-abi3-manylinux_2_28_x86_64.whl (6.9 MB view details)

Uploaded CPython 3.10+manylinux: glibc 2.28+ x86-64

ruviz-0.4.20-cp310-abi3-macosx_11_0_arm64.whl (6.9 MB view details)

Uploaded CPython 3.10+macOS 11.0+ ARM64

ruviz-0.4.20-cp310-abi3-macosx_10_12_x86_64.whl (7.2 MB view details)

Uploaded CPython 3.10+macOS 10.12+ x86-64

File details

Details for the file ruviz-0.4.20.tar.gz.

File metadata

  • Download URL: ruviz-0.4.20.tar.gz
  • Upload date:
  • Size: 5.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ruviz-0.4.20.tar.gz
Algorithm Hash digest
SHA256 160401da6df7aa6faf0a3696b4ded3b3bdafb3f0e75a6ae4808fc952b41e9afd
MD5 98e122a5d9799bfb9a799e9d7b62704c
BLAKE2b-256 aedd22f06c6d389a513a70cc9237c3ed376b5049b7c8061e8687e2895d149220

See more details on using hashes here.

Provenance

The following attestation bundles were made for ruviz-0.4.20.tar.gz:

Publisher: release.yml on Ameyanagi/ruviz

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ruviz-0.4.20-cp310-abi3-win_amd64.whl.

File metadata

  • Download URL: ruviz-0.4.20-cp310-abi3-win_amd64.whl
  • Upload date:
  • Size: 7.0 MB
  • Tags: CPython 3.10+, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ruviz-0.4.20-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 c9eb1df51a86874c7d7110d20cb1207869bf524aa336d943c3cc322f50a38c45
MD5 d0a6d86ba0400bec0a23b75f718409eb
BLAKE2b-256 f1de745e8ab56d5c17cf86abdacce61840ef7e13634c3cac2d7becded91b19d9

See more details on using hashes here.

Provenance

The following attestation bundles were made for ruviz-0.4.20-cp310-abi3-win_amd64.whl:

Publisher: release.yml on Ameyanagi/ruviz

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ruviz-0.4.20-cp310-abi3-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for ruviz-0.4.20-cp310-abi3-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 da500f5ad0729c8d5e156f1a18a84ec433061606c395766e7549d2ebe4d81af7
MD5 290921f69863351227882d2bac1d20f7
BLAKE2b-256 1f03d6d5d7dd988aff0ba51fcd6436e4c518d2da7467ed6993032bc579e10e3c

See more details on using hashes here.

Provenance

The following attestation bundles were made for ruviz-0.4.20-cp310-abi3-manylinux_2_28_x86_64.whl:

Publisher: release.yml on Ameyanagi/ruviz

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ruviz-0.4.20-cp310-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for ruviz-0.4.20-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 045e86a08319341b405732b021203c8d7a70a0c39a831179902a87a36a4fa7d8
MD5 ecc2ff7f2d3ed91f85c223ee76ca4293
BLAKE2b-256 fce9979f9f674f02101ac536504c19f925c0b60a90cb9ed5217ef7d6ee79cace

See more details on using hashes here.

Provenance

The following attestation bundles were made for ruviz-0.4.20-cp310-abi3-macosx_11_0_arm64.whl:

Publisher: release.yml on Ameyanagi/ruviz

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ruviz-0.4.20-cp310-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for ruviz-0.4.20-cp310-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 4238c8d26bc20fd208c9e7a94931432a95197dfb2851c44c8721445cbf91ae9b
MD5 fd684c91cec5d377be468688afa0412c
BLAKE2b-256 b7cff23a297208d51b3c41b8ea6f5838ace60de25fbe4e30044a56d6145c120c

See more details on using hashes here.

Provenance

The following attestation bundles were made for ruviz-0.4.20-cp310-abi3-macosx_10_12_x86_64.whl:

Publisher: release.yml on Ameyanagi/ruviz

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page