Skip to main content

Interactive graph and surface plotter with python expressions.

Project description

P R I N G L E

Interactive 3D plotting for Python. Define surfaces, vector fields, scatter plots, and dynamical system trajectories using real Python/numpy expressions — then explore them live with sliders and animation.


Install + Run:

pip install pringle

crunch 

Why Pringle?

Real Python — expressions are plain Python/numpy. sin(x)*cos(y), scipy.special.gamma(x), user-defined lambdas — no domain-specific language to learn. Numpy functions are available by name (sin, cos, linspace, random, …) with no prefix required.

Live interactivity — any named scalar assignment (a = 1.0) becomes a slider. Drag it and every dependent expression re-evaluates instantly via a reactive dependency graph, at 60 fps on a background thread.

User controls - Fly through your plot like a video game, using the WASD controls to move around + SPACE/SHIFT to move up and down.

Animate anything — press ▷ on any slider and it loops over its range automatically. Camera orbit and pan stay fluid even while the scene is re-evaluating.

Version-controlled sessions — plot sessions are stored in human-readable YAML files. git diff shows exactly what changed; send a single .yml file to share a visualization with a collaborator.

LLM Compatibility — human readable session files + python-native expressions mean large language models are able to generate sophisticated pringle plots on the fly.

GPU-accelerated rendering — powered by pygfx + wgpu-py. Smooth Phong shading, order-independent transparency, and drop shadows — not matplotlib's software renderer.

Vector fields — native 2D and 3D arrow rendering, auto-detected from array shapes (N, 4) and (N, 6).

Recurrence relations — express ODE trajectories directly: path[n] = path[n-1] + dt * deriv(path[n-1]) with an initial condition sub-cell. Re-evaluates reactively on every slider tick.

Piecewise expressionsz = [f, g, h] with condition sub-cells produces a single unified surface.

Constraint masking — boolean sub-cells clip any surface without touching the expression.

Folders and comments — organize complex sessions; collapsed folders keep the expression panel clean.

Pringle vs. Other Tools

Pringle Desmos 3D matplotlib Axes3D Plotly
Language Python / numpy Custom math notation Python Python
Live sliders Requires Dash
GPU rendering ✓ (wgpu) ✓ (WebGL)
Vector fields Limited
Recurrence / ODE paths Limited Manual Manual
scipy / custom functions
Version-controllable ✓ (YAML)

Installation

pip install pringle

Requires Python ≥ 3.11.

Running Pringle

# Open a saved session
crunch path/to/session.yml

# Open a tutorial
crunch pringle/examples/tutorials/01_hello_surface.yml

# Alternative pringle alias
pringle pringle/examples/tutorials/03_animation.yml

Expression Language

Cells evaluate as plain Python. Spatial variables x, y, u, v are injected as numpy arrays over the evaluation grid. Output type is determined by the magic variable assigned:

Assignment Renders as
z = ... Explicit surface (N, M)
xyz = ... Parametric surface or curve (3, N, M) or (3, N)
points = ... Scatter plot (N, 3) or (N, 2)
f(x, y) = ... Auto-rendered surface + reusable namespace function

Shapes (N, 4) and (N, 6) are auto-detected as 2D and 3D vector fields respectively. They are viewed as N row vectors, with each row having the tail and head coordinates concatenated together.

Tutorials

Step-by-step sessions in pringle/examples/tutorials/:

File Concept
01_hello_surface.yml First surface — explicit z = sin(x) * cos(y)
02_sliders.yml Interactive slider parameters
03_animation.yml Animated slider — traveling wave
04_parametric.yml Parametric surface — sphere via xyz
05_constraints.yml Constraint sub-cells — clipping a surface
06_scatter.yml Scatter plot — helix point cloud
07_vector_field.yml 2D vector field — gradient of a surface
08_recurrence.yml Recurrence relation — integrating an ODE

More complex real-world examples live in pringle/examples/.

Further Reading

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

pringle-0.2.0.tar.gz (1.3 MB view details)

Uploaded Source

Built Distribution

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

pringle-0.2.0-py3-none-any.whl (1.2 MB view details)

Uploaded Python 3

File details

Details for the file pringle-0.2.0.tar.gz.

File metadata

  • Download URL: pringle-0.2.0.tar.gz
  • Upload date:
  • Size: 1.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pringle-0.2.0.tar.gz
Algorithm Hash digest
SHA256 bd2c475ff0ff82d1a9f91e10236dba553ef375ff55415615dc9c6722dfcdf14f
MD5 966353036c4399ef3967c928d12d7700
BLAKE2b-256 a280b278ea908e08fe305642eda3c7a253da6fc93af8bb1cab4857919d598ae2

See more details on using hashes here.

Provenance

The following attestation bundles were made for pringle-0.2.0.tar.gz:

Publisher: publish.yml on agbrothers/pringle

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

File details

Details for the file pringle-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: pringle-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 1.2 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pringle-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b1855456f6a46f5f2f26936d3b52052b95a7d1c8218140bcf7b66875db75c5ae
MD5 220ef7346a180dc65ac59c1cc61c3fb5
BLAKE2b-256 28de763176f25756e0f49c152c6b21f8330c7c876806ce40a17a1e91ee34d79a

See more details on using hashes here.

Provenance

The following attestation bundles were made for pringle-0.2.0-py3-none-any.whl:

Publisher: publish.yml on agbrothers/pringle

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