GPU-Rendered Fastplotlib Charts in Preswald

Amrutha GujjarAmrutha Gujjar4 min read

Category: Product


To close out Launch Week, Preswald now supports Fastplotlib — a high-performance plotting library built on WebGPU — as a static visualization backend.

This allows you to drop in Fastplotlib figures right inside your Preswald app, using only Python. It’s ideal for scientific visualizations and high-volume datasets where rendering performance matters.

img


Why Fastplotlib?

Fastplotlib is gaining adoption in the scientific Python ecosystem for its speed, GPU rendering, and clean API. It’s great for 2D and 3D visualizations, and often used in fields like:

  • ⚛️ Scientific computing

  • 🔬 Microscopy and medical imaging

  • 📈 High-volume sensor data

  • 🧪 ML model inspection and diagnostics

Preswald now supports static rendering of these figures, meaning you can include them as part of your dashboards or tools — no screenshots or manual export needed.


Quick Example

from preswald import fastplotlib
import fastplotlib as fpl

fig = fpl.Figure()

# Example: static image using Fastplotlib primitives
img = fig[0, 0].add_image(data=...)  # your ndarray or image tensor
fastplotlib(fig)

That’s all you need — Preswald will handle the static rendering and display the figure in your app layout.

img


Key Properties

  • 📦 GPU rendering for high-performance visuals

  • 🖼 Static display — ideal for snapshots, not interactivity

  • ✅ Works alongside Plotly, Matplotlib, and all other Preswald components

  • 💡 No need to export images — pass the Python object directly


Limitations

Right now, Preswald renders Fastplotlib figures as static images (PNG). Interactivity (e.g. zoom, pan, hover) is not yet supported — but we’re tracking that as a potential future addition.

Still, for sharing scientific results or benchmarking outputs, this is a fast and efficient option.


Example Use Cases

  • Labs showcasing the output of image processing pipelines

  • ML dashboards that include annotated heatmaps or filters

  • Static overlays of sensor data, spectra, or MRI slices


Community Contributions

This feature came together thanks to:

Explore the Code


Wrapping Up Launch Week

That’s a wrap on Preswald OSS Launch Week!
Here’s what we shipped:

  1. Query APIs as live tables

  2. Render Matplotlib inside apps

  3. Load CSVs from S3

  4. Drop in AI Chat over your data

  5. GPU-powered Fastplotlib charts

We’re grateful to all the contributors who made these possible — and to the community that keeps pushing the boundaries of what Python data apps can do.

Onward 🚀