Skip to content
github-actions[bot] edited this page Mar 22, 2026 · 19 revisions

FastPlot Home

Ultra-fast time series plotting for MATLAB and GNU Octave with dynamic downsampling, sensor monitoring, and dashboard layouts.

What Is FastPlot?

FastPlot is a pure-MATLAB/Octave plotting library engineered for speed and interactivity on large datasets. It achieves 212 FPS on 10M-point datasets through intelligent per-pixel downsampling, lazy multi-resolution pyramids, and optional SIMD-accelerated MEX kernels. The library comprises five tightly integrated modules:

  1. FastSense — Core time-series plotter with dynamic downsampling, layouts, toolbar, themes, and disk-backed storage
  2. Dashboard — Widget-based dashboarding with 8 widget types on a 24-column responsive grid
  3. SensorThreshold — Sensor containers with state-dependent threshold rules and violation detection
  4. EventDetection — Real-time event detection with Gantt visualization and live pipeline
  5. WebBridge — TCP-based web integration for browser dashboards

All components work without external dependencies and fall back gracefully to pure MATLAB when MEX is unavailable.

Why FastPlot?

The Problem: MATLAB's built-in plot() becomes unusably slow above 100K points due to graphics pipeline overhead and per-vertex rendering.

FastPlot's Solution:

  • Screen-resolution downsampling — reduces 10M points to ~4K displayed via smart binning
  • Per-pixel MinMax — preserves spikes and valleys even at 99.96% reduction
  • Lazy pyramid caching — instant zoom-out on 50M+ datasets with zero re-scan overhead
  • SIMD MEX acceleration — 10-50x faster downsampling via C vectorization (optional)
  • Disk-backed storage — SQLite chunks for 100M+ point datasets with memory-mapped access

The Result: Fluid interactive zoom/pan on datasets that would normally require subsampling, data aggregation, or specialized tools.

Key Features

Feature Benefit
Dynamic downsampling MinMax and LTTB algorithms automatically select based on zoom level
Pyramid cache Multi-resolution pre-computation—zoom out instantly from 100M points
Dashboard layouts FastSenseGrid for tiled plots, FastSenseDock for tabbed views
Sensor framework State-dependent thresholds with condition-based rules and violation markers
Interactive toolbar Data cursor, crosshair, grid toggle, autoscale, PNG export
Event detection Group threshold violations into events with Gantt timeline and click-to-plot
Live mode File polling with synchronized multi-plot updates
6 themes default, dark, light, industrial, scientific, ocean—plus custom overrides
Linked axes Synchronized zoom/pan across subplots via shared LinkGroup
Zero dependencies Pure MATLAB/Octave; works with or without Signal/Statistics toolboxes

Performance Metrics

graph LR
    A["10M Points"]
    B["Downsampled<br/>~4K Points"]
    C["Rendered<br/>212 FPS"]
    A -->|"99.96% reduction<br/>4.7 ms"| B
    B -->|"GPU rasterize<br/>per frame"| C
    D["0.06 MB<br/>GPU RAM"] -->|"vs 153 MB<br/>for plot"| E["2550x<br/>more efficient"]
Loading

Benchmark Summary:

  • 10M-point zoom cycle: 4.7 ms (212 FPS interactive)
  • Point reduction: 10M → ~4K displayed (99.96% culled)
  • Memory efficiency: 0.06 MB GPU vs 153 MB for plot()
  • MEX acceleration: 10-50x speedup on downsampling kernels (optional)

See the Performance page for detailed benchmarks and tuning options.

Quick Start

Install and Compile

install;  % Adds paths, compiles MEX with architecture auto-detection

Basic Plot (10M Points)

fp = FastSense('Theme', 'dark');
x = linspace(0, 100, 1e7);
y = sin(x) + 0.1 * randn(size(x));

fp.addLine(x, y, 'DisplayName', 'Temperature');
fp.addThreshold(0.8, 'Direction', 'upper', 'ShowViolations', true, 'Label', 'Warning');
fp.addThreshold(0.95, 'Direction', 'upper', 'ShowViolations', true, 'Label', 'Alarm');

fp.render();

Dashboard with Multiple Tiles

% Create a 2×2 grid
fig = FastSenseGrid(2, 2, 'Theme', 'industrial');
fig.setTileSpan(1, [1 2]);  % Tile 1 spans both columns

% Pressure plot (top, full width)
fp1 = fig.tile(1);
fp1.addLine(x, sin(x), 'DisplayName', 'Pressure');
fp1.addBand(0.8, 1.0, 'FaceColor', [1 0 0], 'FaceAlpha', 0.1, 'Label', 'Alarm Zone');
fig.setTileTitle(1, 'Pressure Monitor');

% Temperature plot (bottom-left)
fp2 = fig.tile(2);
fp2.addLine(x, cos(x), 'DisplayName', 'Temperature');
fig.setTileTitle(2, 'Temperature');

% Vibration plot (bottom-right)
fp3 = fig.tile(3);
fp3.addLine(x, randn(1, 1e7) * 0.5, 'DisplayName', 'Vibration');
fig.setTileTitle(3, 'Vibration');

fig.renderAll();

Sensor with State-Dependent Thresholds

% Create a sensor
s = Sensor('chamber_pressure', 'Name', 'Chamber Pressure', 'Units', 'bar');
s.X = linspace(0, 3600, 1e6);  % 1 hour, 1000 Hz sample rate
s.Y = randn(1, 1e6) * 5 + 50;  % Noisy baseline ~50 bar

% Add a state channel (machine operating mode)
sc = StateChannel('machine');
sc.X = [0 600 1200 2400];       % Mode changes at these times
sc.Y = [0 1 2 1];               % Idle → Running → Evacuating → Running
s.addStateChannel(sc);

% Add conditional thresholds
s.addThresholdRule(struct('machine', 0), 30, 'Direction', 'upper', 'Label', 'Idle Warning');
s.addThresholdRule(struct('machine', 1), 60, 'Direction', 'upper', 'Label', 'Run High');
s.addThresholdRule(struct('machine', 1), 40, 'Direction', 'lower', 'Label', 'Run Low');
s.addThresholdRule(struct('machine', 2), 80, 'Direction', 'upper', 'Label', 'Evac Limit');

% Resolve thresholds (compute violations)
s.resolve();

% Plot with toolbar
fp = FastSense('Theme', 'scientific');
fp.addSensor(s, 'ShowThresholds', true);
toolbar = FastSenseToolbar(fp);
fp.render();

Navigation

graph TD
    A["🏠 Home<br/>What is FastPlot?"]
    B["📖 Getting Started<br/>14-lesson tutorial"]
    C["⚙️ Installation<br/>Setup and MEX build"]
    D["📚 API Reference<br/>Class documentation"]
    E["📊 Guides<br/>Features deep-dives"]
    F["💡 Examples<br/>80+ runnable patterns"]
    G["🔧 Advanced<br/>Architecture, perf, MEX"]
    
    A --> B
    A --> C
    A --> D
    A --> E
    A --> F
    A --> G
Loading

Start Here:

Technology Stack

Layer Technology
Core Pure MATLAB/Octave, zero external dependencies
Graphics MATLAB line, patch, axes objects (R2020b compatible)
Acceleration Optional C MEX with SIMD (AVX2/x86_64, NEON/ARM64, SSE2 fallback)
Storage SQLite 3 (bundled in MEX) for disk-backed DataStore
Web NDJSON-over-TCP + Python bridge + FastAPI/WebSocket frontend
Testing MATLAB Unit Test Framework + Octave test runner

Requirements

  • MATLAB R2020b or later, OR GNU Octave 7.0+
  • C compiler (optional) — GCC 9+, Clang 10+, or MSVC 2019+
  • No toolboxes required — Signal/Statistics/Parallel toolboxes optional for advanced features

Project Status

Current Version: 1.0 (beta)
Maturity: Production-ready core (plotting, sensors, events). Dashboard engine and WebBridge in active development.

Component Status
FastSense plotting ✅ Stable, well-tested
Sensors & thresholds ✅ Stable, field-tested
Event detection ✅ Stable, well-tested
Dashboard engine ⚠️ Stable, minor API refinements possible
WebBridge ⚠️ MVP complete, performance tuning ongoing
MEX acceleration ✅ Stable, all platforms tested

Learning Paths

Contributing & Support

License

FastPlot is released under the MIT License. See LICENSE.txt for details.


Last updated: 2026-03-19
Auto-generated from source code — see scripts/generate_wiki.py

Clone this wiki locally