-
Notifications
You must be signed in to change notification settings - Fork 0
API Reference: Themes
FastPlot includes a configurable theme system with 6 built-in presets, 3 color palettes, and full customization.
Function that returns a theme struct. Not a class — returns a plain struct.
t = FastSenseTheme(); % Returns 'default' preset
t = FastSenseTheme('dark'); % Named preset
t = FastSenseTheme('dark', 'FontSize', 14, 'LineWidth', 2.0); % Preset with overrides
t = FastSenseTheme(struct('Background', [0 0 0])); % Custom struct (merged with defaults)% At construction
fp = FastSense('Theme', 'dark');
fig = FastSenseGrid(2, 2, 'Theme', 'industrial');
dock = FastSenseDock('Theme', 'scientific');
% After construction
fp.Theme = FastSenseTheme('dark');
fp.reapplyTheme();White background, standard MATLAB-like colors. Good for general use.
- Background: white [1 1 1]
- Axes: white
- Grid: light gray, dotted
- Font: Helvetica, 10pt
- Palette: 7-color vibrant set
Dark gray background with bright, high-contrast lines. Good for monitoring dashboards.
- Background: dark gray [0.15 0.15 0.15]
- Axes: slightly lighter [0.18 0.18 0.18]
- Foreground: light gray [0.9 0.9 0.9]
- Grid: gray, low alpha
- Palette: bright neon-inspired colors
Soft white background with muted, comfortable colors. Good for long analysis sessions.
- Background: off-white [0.98 0.98 0.98]
- Axes: white
- Grid: light, subtle
- Palette: muted, softer tones
High contrast with engineering-style presentation. Good for plant monitoring.
- Background: very dark [0.1 0.1 0.1]
- Bold grid lines
- Larger fonts
- Palette: high-visibility colors
Publication-ready. Serif font, no grid, colorblind-safe palette.
- Background: white
- Font: Times New Roman (or serif)
- No grid (GridStyle = 'none')
- Palette: Wong (2011) colorblind-safe 7-color set
- Thinner lines
Deep blue-green color scheme. Good for marine, environmental, or dark-themed dashboards.
- Background: deep navy [0.05 0.12 0.18]
- Axes: dark teal [0.07 0.16 0.24]
- Foreground: cool gray-blue
- Palette: cool-toned colors
| Field | Type | Default | Description |
|---|---|---|---|
| Background | 1x3 RGB | [1 1 1] | Figure background color |
| AxesColor | 1x3 RGB | [1 1 1] | Axes background color |
| ForegroundColor | 1x3 RGB | [0.15 0.15 0.15] | Text, tick labels, axis lines |
| GridColor | 1x3 RGB | [0.8 0.8 0.8] | Grid line color |
| GridAlpha | double | 0.5 | Grid transparency (0-1) |
| GridStyle | char | ':' | Grid line style: '-', '--', ':', '-.', 'none' |
| FontName | char | 'Helvetica' | Font family for labels and titles |
| FontSize | double | 10 | Base font size for axis labels |
| TitleFontSize | double | 12 | Title font size |
| LineWidth | double | 0.5 | Default data line width |
| LineColorOrder | Nx3 or char | (7-color set) | Color cycle matrix or palette name |
| ThresholdColor | 1x3 RGB | [0.8 0 0] | Default threshold line color |
| ThresholdStyle | char | '--' | Default threshold line style |
| ViolationMarker | char | 'o' | Default violation marker shape |
| ViolationSize | double | 4 | Default violation marker size (points) |
| BandAlpha | double | 0.1 | Default band fill transparency |
LineColorOrder can be an Nx3 RGB matrix or one of these named palettes:
Bright, distinct colors optimized for dark and light backgrounds.
Softer, desaturated colors for a professional look. Less eye strain.
Wong (2011) colorblind-safe palette. 7 colors distinguishable by people with the most common forms of color vision deficiency. Used by the 'scientific' preset.
Usage:
t = FastSenseTheme('dark', 'LineColorOrder', 'colorblind');
t = FastSenseTheme('default', 'LineColorOrder', 'muted');Custom palette:
myColors = [
0.2 0.4 0.8; % Blue
0.8 0.2 0.2; % Red
0.2 0.7 0.3; % Green
0.9 0.6 0.1; % Orange
];
t = FastSenseTheme('dark', 'LineColorOrder', myColors);Themes cascade with this priority (highest first):
Element override > Tile theme > Figure theme > 'default' preset
- Element override — Color/LineWidth etc. passed directly to addLine(), addThreshold()
- Tile theme — setTileTheme() overrides for specific tiles
- Figure theme — Theme from FastSenseGrid or FastSense constructor
- default preset — Fills in any unspecified fields
Each level only needs to specify the fields it wants to change. Unspecified fields cascade from the next level.
% Figure uses dark theme
fig = FastSenseGrid(2, 2, 'Theme', 'dark');
% Tile 2 overrides just the background
fig.setTileTheme(2, struct('Background', [0.1 0.1 0.2]));
% Individual line overrides color
fp = fig.tile(1);
fp.addLine(x, y, 'Color', [1 0.5 0]); % Orange, overrides theme paletteGlobal default configuration. All FastSense instances inherit these unless overridden.
% View current defaults (edit the function to change)
FastSenseDefaults()| Field | Default | Description |
|---|---|---|
| Theme | 'default' | Default theme preset |
| ThemeDir | 'themes' | Custom theme folder |
| Verbose | false | Diagnostics |
| MinPointsForDownsample | 5000 | Raw plotting threshold |
| DownsampleFactor | 2 | Points per pixel |
| PyramidReduction | 100 | Pyramid compression factor |
| DefaultDownsampleMethod | 'minmax' | Downsampling algorithm |
| XScale | 'linear' | Default X scale |
| YScale | 'linear' | Default Y scale |
| LiveInterval | 2.0 | Polling interval (seconds) |
| DashboardPadding | [0.06 0.04 0.01 0.02] | Dashboard edge padding |
| DashboardGapH | 0.03 | Horizontal tile gap |
| DashboardGapV | 0.06 | Vertical tile gap |
| TabBarHeight | 0.03 | Dock tab bar height |
To reset cached defaults:
FastSense.resetDefaults();t = FastSenseTheme('dark', 'FontSize', 14, 'TitleFontSize', 18, 'LineWidth', 2.0);
fp = FastSense('Theme', t);t = FastSenseTheme('scientific', ...
'LineColorOrder', [0 0 0; 0.5 0.5 0.5; 0 0 0.8], ...
'LineWidth', 1.0, ...
'FontSize', 12);
fp = FastSense('Theme', t);t = FastSenseTheme('industrial', 'GridAlpha', 0.1, 'BandAlpha', 0.08);
fig = FastSenseGrid(2, 2, 'Theme', t);- API Reference: FastPlot — Using themes with plots
- API Reference: Dashboard — Dashboard-level theming
FastPlot Wiki
API Reference
Guides
Use Cases
Internals
Resources