ruviz
High-performance 2D plotting library for Rust combining matplotlib's ease-of-use with Makie's performance.
Quick Start
use *;
let x: = .map.collect;
let y: = x.iter.map.collect;
new
.line
.title
.xlabel
.ylabel
.save?;

Features
🛡️ Safety & Quality
- Zero unsafe in public API
- Strong type system prevents runtime errors
- Comprehensive error handling with
Resulttypes - Memory-safe by design
📊 Plot Types
Basic: Line, Scatter, Bar, Histogram, Box Plot, Heatmap Distribution: Violin, KDE, ECDF Composition: Pie, Donut Continuous: Contour Polar: Polar Plot, Radar Chart Error: Error Bars (symmetric/asymmetric)
🎨 Publication Quality
- High-DPI export: 72, 96, 300, 600 DPI for print
- Multiple formats: PNG, SVG (SVG in development)
- Professional themes: Light, Dark, Publication, Seaborn-style
- Custom styling: Colors, fonts, markers, line styles
- International text: Full UTF-8 support (Japanese, Chinese, Korean, etc.) with cosmic-text
⚡ Advanced Features
- Simple API: One-liner functions for quick plotting
- Parallel rendering: Multi-threaded for large datasets (rayon)
- GPU acceleration: Optional wgpu backend (experimental)
- Interactive plots: Optional winit window integration
- Animation: GIF export with
record!macro and easing functions - Cross-platform: Linux, macOS, Windows
Installation
Add to your Cargo.toml:
[]
= "0.1"
Feature Flags
Choose features based on your needs:
[]
= { = "0.1", = ["parallel", "simd"] }
| Feature | Description | Use When |
|---|---|---|
default |
ndarray + parallel | General use |
parallel |
Multi-threaded rendering | Large datasets |
simd |
Vectorized transforms | Performance-critical |
animation |
GIF animation export | Animated plots |
gpu |
GPU acceleration (experimental) | Real-time rendering |
interactive |
winit window support | Interactive plots |
ndarray_support |
ndarray types | Scientific computing |
polars_support |
DataFrame support | Data analysis |
pdf |
PDF export | Publication output |
full |
All features | Power users |
For minimal builds: default-features = false
Examples
Basic Line Plot
use *;
let x = vec!;
let y = vec!;
new
.line
.title
.save?;
Multi-Series with Styling
use *;
let x = vec!;
new
.line
.label
.line
.label
.line
.label
.title
.xlabel
.ylabel
.theme
.save?;
Subplots
use *;
let plot1 = new.line.title.end_series;
let plot2 = new.scatter.title.end_series;
let plot3 = new.bar.title.end_series;
let plot4 = new.histogram.title.end_series;
subplots?
.suptitle
.subplot?
.subplot?
.subplot?
.subplot?
.save?;
Large Dataset
use *;
// 100K points with parallel rendering (enable "parallel" feature)
let x: = .map.collect;
let y: = x.iter.map.collect;
new
.line
.title
.save?;
Animation
use *;
use RecordConfig;
use record;
let x: = .map.collect;
let config = new.max_resolution.framerate;
record!?;

Documentation
- User Guide - Comprehensive tutorials and examples
- API Documentation - Complete API reference
- Gallery - Visual examples showcase
- Migration from matplotlib - For Python users
- Migration from seaborn - Statistical plots
- Performance Guide - Optimization techniques
Why ruviz?
Rust's plotting ecosystem has several options, but each has trade-offs:
| Library | Approach | Limitation |
|---|---|---|
| plotters | Low-level drawing API | Verbose, requires boilerplate for common plots |
| plotly.rs | JavaScript bindings | Requires JS runtime, web-focused |
| plotpy | Python/matplotlib wrapper | Requires Python installed |
ruviz fills the gap with:
- High-level API: matplotlib-style
Plot::new().line().title().save()- no boilerplate - Pure Rust: No Python, JavaScript, or external runtime needed
- Built-in plot types: 15+ plot types out of the box (violin, KDE, radar, etc.)
- Publication quality: Professional themes and high-DPI export
// plotters: ~30 lines for a simple line plot
// ruviz: 4 lines
new
.line
.title
.save?;
Contributing
Contributions welcome! Please read CONTRIBUTING.md for guidelines.
Development
# Clone repository
# Setup pre-commit hooks (recommended)
# Run code quality checks
# Run tests
# Run examples
# Run benchmarks
The pre-commit hooks will automatically run cargo fmt --check and cargo clippy before each commit to ensure code quality.
Roadmap
- Core plot types (line, scatter, bar, histogram, boxplot, heatmap)
- Parallel rendering
- SIMD optimization
- GPU acceleration (experimental)
- Professional themes
- Subplots and multi-panel figures
- Distribution plots: Violin, KDE, ECDF
- Composition plots: Pie, Donut
- Continuous plots: Contour
- Polar plots: Polar, Radar
- Error bars
- More plot types: Area, Hexbin, Step, Stem (v0.2)
- Regression plots: Regplot, Residplot (v0.2)
- Composite plots: Joint, Pair (v0.2)
- SVG export (v0.2)
- Interactive plots with zoom/pan (v0.3)
- 3D plotting (v1.0+)
License
Licensed under either of:
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Acknowledgments
- Inspired by matplotlib, seaborn, and Makie.jl
- Built with tiny-skia for rendering
- Text rendering by cosmic-text
- Thanks to the Rust community for excellent crates and feedback
Status: v0.1 - Early development, API may change. Production use at your own risk.
Support: Open an issue or start a discussion