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.
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.
allowed-tools
["Read","Write","Edit","Bash"]
MATLAB Chart Builder
Create, customize, and interact with MATLAB charts and plots — in standalone figures, Live Scripts, or uifigure apps.
When to Use This Skill
Use this skill when:
Plotting data (line, scatter, bar, histogram, heatmap, surface, polar, geo, volume) in any context
User says "help me visualize this" without a specific chart type
When NOT to Use This Skill
Building a full app (use matlab-build-app — it invokes this skill for chart sub-steps)
Applying dark mode, brand colors, or custom color themes (use matlab-apply-theme)
Working with Simulink scopes or Simscape plots
Creating App Designer charts via the drag-and-drop GUI
Workflow
User request arrives
|
+-- FAST PATH (most requests)
| Chart type named OR unambiguous single-axes plot
| AND no interactivity / animation / multi-panel / performance concern
| |
| v
| Infer rendering context (default: standalone figure)
| Read relevant references --> Build directly
|
+-- PLAN PATH (complex or ambiguous)
|
+-- Ambiguous intent (no chart type named, unclear data question)
| --> Identify visualization intent (see Intent Taxonomy)
|
+-- Rendering context unclear AND it matters
| --> Ask: standalone figure, Live Script, or uifigure app?
|
v
Present inline plan for approval
|
v
User confirms --> Read references --> Build
Fast-Path Triggers (build directly, no plan)
ALL of these must hold:
Chart type is named OR intent maps unambiguously to one type
Single axes (no tiled/multi-panel layout)
No custom interactivity (no user-specified callbacks)
No animation or streaming
No explicit performance constraints
Rendering context is clear or defaults to standalone figure
Branded / designed figure requiring palette/theme coordination
Ambiguous "help me visualize this" — unclear type or intent
Multiple visualization intents in one figure
Rendering Context
Three contexts gate which constraint set applies:
Context
Constraints
How inferred
Standalone figure
Universal rules only
Default; figure/axes in request
Live Script
Universal rules only
User mentions Live Script, .mlx, plain-text Live Code
uifigure app
Universal + uifigure rules
User mentions uifigure; arrives as sub-step of app-builder
If context is unstated and cannot be inferred, assume standalone figure. Ask only when the distinction matters (e.g., heatmap parent differs between contexts).
Visualization Intent Taxonomy
Engages ONLY when the user has NOT named a specific chart type or function. If they say "scatter" or "heatmap," skip intent selection and build directly.
Communicative Intents
Intent
Data question
Encouraged functions
Comparison
How do values compare across items?
bar, barh, bar3, bar3h, pareto, stem, stairs, loglog, semilogx, semilogy
The waterfall trap: MATLAB's waterfall is a 3D surface plot, NOT the financial accumulation chart. For "accumulation to total," build from bar with a hidden base series.
f* variants follow their data counterpart's intent: fplot -> Trend, fsurf/fmesh/fcontour -> Surfaces, fimplicit -> Relationship, fpolarplot -> Directional.
Animation is cross-cutting, not an intent. animatedline, comet, comet3 layer motion onto any chart type. See references/animation.md.
Multi-intent functions: Classify by the user's data question, not gallery grouping. E.g., heatmap of a correlation matrix -> Relationship; heatmap of counts -> Comparison.
Classify by communicative intent, not MATLAB docs grouping. piechart/donutchart are Composition regardless of where docs file them.
Inline Plan Template
When the plan path engages, present for approval:
**Chart Plan: [description]**
**Context:** [Standalone figure / Live Script / uifigure app]
**Intent:** [name] -> [chosen function(s)]
**Structure:**
- [Layout description]
- [Key visual elements, annotations, interactions]
**Key decisions:**
- [Performance strategy, if applicable] [src: references/performance.md SS]
- [Interaction model, if applicable] [src: references/interactive-plots.md SS]
- [uifigure constraints that apply, if context = uifigure]
**References to use:**
| Reference | Role | Provenance |
|-----------|------|------------|
| `references/file.md` | [what it provides] | [src: references/file.md SS] |
Shall I proceed?
Do NOT write the plan to a file unless (a) the user explicitly asks for a spec to keep, or (b) chart-builder is running as a sub-step of an app build with an existing plan artifact.
Critical Rules
Universal (all contexts)
MUST pass axes as first argument to all plotting functions: plot(ax, x, y) not plot(x, y)
MUST update data in place (p.XData = newX) — never replot in a loop
MUST use drawnow limitrate for animations — never bare drawnow in tight loops
PREFER tiledlayout/nexttile over subplot() for multiple axes
PREFER exportgraphics() for publication-quality export
Additional constraints in uifigure apps
MUST use uiaxes — never plain axes
MUST use exportgraphics() or exportapp() — saveas/print not supported
NEVER use subplot() — not supported in uifigure
NEVER use annotation() — use text(), xline(), yline(), xregion(), yregion()
NEVER use ginput() — use ButtonDownFcn on plot objects
NEVER rely on gcf/gca — uiaxes has HandleVisibility = 'off' by default