Skip to content

matlab/matlab-agentic-toolkit / skills-catalog/matlab-app-building/matlab-build-chart

matlab-build-chart

Verified

Create and customize MATLAB charts and plots. Plot types (line, scatter, bar, histogram, heatmap, surface), axes configuration, annotations, data tips, interactive plots, animation, multiple axes with tiledlayout, colororder, and performance optimization. Works for standalone figures, Live Scripts, and uifigure apps. Use when plotting data, customizing axes, adding annotations or interactivity, animating charts, or arranging multiple axes. Triggers: plot, chart, graph, axes, uiaxes, annotation, data tips, animation, tiledlayout, colororder, heatmap, scatter, figure, visualization, export.

FileKindSize
SKILL.mdskill md13.7 KB
manifest.yamlconfig523 B
references/animation.mdexecutablescript2.1 KB
references/annotations.mdexecutablescript1.2 KB
references/axes-config.mdexecutablescript2.2 KB
references/chart-palettes.mdexecutablescript1.8 KB
references/data-tips.mdexecutablescript976 B
references/interactive-plots.mdexecutablescript2.9 KB
references/multiple-axes.mdexecutablescript2.4 KB
references/performance.mdexecutablescript4.0 KB
references/plot-types.mdexecutablescript2.4 KB

references/chart-palettes.md

View on GitHub
# Chart Color Palettes

## Custom Brand Palette via Theme Struct

```matlab
% Set on specific axes
colororder(ax, theme.plotColors);

% Or set on figure (affects all axes)
colororder(fig, theme.plotColors);
```

## Named Palettes (R2023b+)

```matlab
colororder("gem")     % Light theme default (7 colors)
colororder("glow")    % Dark theme default
colororder("sail")    % Cool blue tones
colororder("reef")    % Warm earth tones
colororder("meadow")  % Green/natural tones
colororder("earth")   % Muted earth
colororder("dye")     % Vibrant saturated
```

## Calling colororder Correctly

**Call `colororder` after plotting.** Calling it before `plot` on axes with `NextPlot` set to `'replace'` (the default) will lose the color order when the first plot command resets the axes.

```matlab
fig = figure;
ax = axes(fig);
plot(ax, x, y1, x, y2, x, y3);
colororder(ax, "gem");   % Applied after plotting — colors update correctly
```

## Theme-Adaptive Plots with SeriesIndex

For plots that auto-adapt between light/dark without custom colors:

```matlab
fig = uifigure;
ax = uiaxes(fig);
hold(ax, 'on');
p1 = plot(ax, data1);  % SeriesIndex = 1 (auto)
p2 = plot(ax, data2);  % SeriesIndex = 2 (auto)
% When theme switches: gem[1] → glow[1], gem[2] → glow[2] automatically
```

**Important:** Do NOT set line colors explicitly if you want adaptive behavior. `plot(ax, data, 'r')` forces `ColorMode = "manual"`. Use `p.SeriesIndex = 3` to change a line's color within the current colororder.

## colororder vs colormap

- **`colororder`** — discrete series (lines, bars, scatter groups). Set via palette name or Nx3 matrix.
- **`colormap`** — continuous scalar-to-color mapping (heatmaps, surfaces, contours). Set via `colormap(ax, "parula")` etc.

----

Copyright 2026 The MathWorks, Inc.

----
brainstormingobra/superpowersYou MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation).Stars: 322kUpdated Claude CodeCodexVerifiedInstall
brand-guidelinesanthropics/skillsApplies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
frontend-designanthropics/skillsGuidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making choices that don't read as templated defaults.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
mcp-builderanthropics/skillsGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).Stars: 198kUpdated Claude CodeCodexVerifiedInstall