Skip to main content

No project description provided

Project description

rtplot — real-time plotting over ZMQ

rtplot pushes live data from a Python script to a browser plot — locally or across a network — in a few lines of code. The plot page also hosts interactive widgets (buttons, sliders, dials, numeric / text displays) that feed values back to the sender in real time.

Typical use: a robot or data-acquisition script runs on a Raspberry Pi, and you watch signals and tweak gains from a laptop on the same Wi-Fi.


How it works

Two processes talking over ZMQ, plus a browser viewer:

flowchart TD
    script["Your Python script<br/>send_array() · poll_controls()"]
    subgraph server["rtplot-server"]
        browser["browser tab<br/>localhost:8050"]
    end
    script -- "data :5555" --> server
    server -- "controls :5556" --> script

Sender and server don't have to be on the same machine — see the networking guide.


Install

Server — grab the prebuilt binary from the Releases page:

Platform Asset
Windows rtplot-server-<version>-windows-x64.exe
Linux rtplot-server-<version>-linux-x86_64.tar.gz
macOS (Apple Silicon) rtplot-server-<version>-macos-arm64.tar.gz

No Python needed on the viewing machine. On Windows the binary opens a small Tk status window showing the listening URL.

Client — pip install in the env that runs your script:

pip install better-rtplot

(If you'd rather run the server from Python too, use pip install "better-rtplot[browser]" — see the API reference.)


Your first plot

flowchart TD
    t1["terminal 1: start the server"]
    t2["terminal 2: run your script"]
    br["browser: open localhost:8050"]
    t1 --> t2 --> br

Terminal 1 — start the server. Run the prebuilt rtplot-server binary you downloaded above. Open http://localhost:8050 in a browser — the page is blank until data arrives.

Terminal 2 — run your sender script. Save as my_plot.py:

from rtplot import client
import time

client.local_plot()
client.initialize_plots(["my signal"])

for i in range(1000):
    client.send_array(i * 0.01)
    time.sleep(0.01)
python my_plot.py

A rising line now draws itself in the browser tab.


Highlights

  • Fast. Binary WebSocket deltas up to 1 kHz; the browser coalesces samples into one repaint per requestAnimationFrame, so rendering tracks your monitor refresh rate regardless of sample rate.
  • Browser-based. aiohttp + uPlot, no desktop GUI toolkit, works over SSH port forwarding.
  • Remote-friendly. Sender or plot host can bind. Live Bind / Connect buttons retarget without restart.
  • Config lives with the data. The sender declares plot layout.
  • Interactive controls. Buttons, sliders, dials, displays — polled from your loop, no threads, no callbacks.
  • Static HTML snapshots. save_snapshot("out.html") writes a self-contained ~65 KB file with the current trace embedded.

Where to go next

  • API reference — every rtplot.client function, the plot-layout schema, interactive controls, snapshots, browser UI, and rtplot-server CLI flags.
  • Networking guide — Mode A vs. Mode B, viewing from a phone or second laptop, the WSL2 wrinkle, Cloudflare Tunnel, Tailscale.
  • Examples — runnable scripts with embedded HTML snapshots you can open offline.

Issues and feature requests: github.com/jmontp/rtplot/issues.

Project details


Download files

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

Source Distribution

better_rtplot-0.4.1.tar.gz (86.5 kB view details)

Uploaded Source

Built Distribution

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

better_rtplot-0.4.1-py3-none-any.whl (88.8 kB view details)

Uploaded Python 3

File details

Details for the file better_rtplot-0.4.1.tar.gz.

File metadata

  • Download URL: better_rtplot-0.4.1.tar.gz
  • Upload date:
  • Size: 86.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.12.3 Linux/6.6.87.2-microsoft-standard-WSL2

File hashes

Hashes for better_rtplot-0.4.1.tar.gz
Algorithm Hash digest
SHA256 6f7c978db65003d1810bf6fa3fcc6b6a3dc754b23a7855d67ac1155d52d34666
MD5 e26ca0b5cd0653de7dab12046735ab14
BLAKE2b-256 d0df4951be2be64ac7b765ac8a70833c20156c46e91444f66e3a90cc89e275b3

See more details on using hashes here.

File details

Details for the file better_rtplot-0.4.1-py3-none-any.whl.

File metadata

  • Download URL: better_rtplot-0.4.1-py3-none-any.whl
  • Upload date:
  • Size: 88.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.12.3 Linux/6.6.87.2-microsoft-standard-WSL2

File hashes

Hashes for better_rtplot-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4724153883ec58c773509447a1150dd6def5ea29a1e2e9f5957d6d524819f6e5
MD5 50da15376dcf9f5865c8a0800a0a5f80
BLAKE2b-256 fb162461a7beb389d61e796e39a2a34d136a1246d9a6f3d234be22f9b07a1447

See more details on using hashes here.

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