Matlab Build Chart
MathWorksOfficialCreated by MathWorks
- Skill
- Tool integration
- Data and AI
- BSD-2-Clause
- No issues found
AutoGineer summary
Written by AutoGineer from the skill’s own files, not by the author
The MATLAB Chart Builder skill provides a structured approach to generating and refining data visualizations within the MATLAB environment. It supports a wide range of plot types, including line, scatter, bar, histogram, heatmap, and surface plots. The skill manages axes configuration, annotations, data tips, interactive plot behaviors, and animations. It is designed to work across standalone figures, Live Scripts, and uifigure apps, ensuring that plotting commands are compatible with the chosen rendering context. The skill includes a planning workflow for complex requirements such as multi-panel layouts, performance optimization, or custom interactivity.
What it does
- Generates various plot types including line, scatter, bar, histogram, heatmap, and surface.
- Configures axes, labels, limits, ticks, legends, and fonts.
- Adds annotations such as reference lines, regions, and text labels.
- Implements interactive plot features like click, hover, and drag callbacks.
- Supports animation and streaming data visualization with performance-focused patterns.
- Arranges multiple axes using tiled layouts and exports figures for reports.
When to use it
- When you need to visualize data using standard or specialized MATLAB plot types.
- When configuring axes, legends, or annotations for a figure.
- When creating interactive plots that respond to user input.
- When animating or streaming data updates in a chart.
- When arranging multiple plots in a single figure using tiled layouts.
- When exporting figures for publication or documentation.
Advantages
- Provides consistent syntax for plotting across different MATLAB contexts.
- Includes specific guidance for uifigure app compatibility.
- Offers performance-oriented patterns for handling large or streaming datasets.
- Supports complex layout arrangements through tiled layouts.
- Enables programmatic control over chart interactivity and annotations.
Usage examples
- “Create a scatter plot of my data in a standalone figure.”
- The agent generates a script using the scatter function, passing an axes handle, and configures the labels and grid.
- “How do I add a vertical reference line to my plot in a uifigure app?”
- The agent provides the xline command, noting that it is compatible with uiaxes and avoids unsupported annotation functions.
- “Help me visualize this data as a heatmap.”
- The agent identifies the intent as image/matrix visualization and provides the code to generate a heatmap with appropriate axes.
- “I need to animate a line plot with streaming data.”
- The agent provides a pattern using animatedline and drawnow limitrate to ensure efficient rendering.
Install
Download the skill as a ZIP:
https://autogineer.com/agent-skills/matlab/matlab-build-chart/downloadUnzip it into the cross-client skills folder of your project:
mkdir -p .agents/skills && unzip matlab-build-chart.zip -d .agents/skills
Documentation by MathWorks
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
Configuring axes (labels, limits, ticks, legend, font, export)
Adding annotations (xline, yline, xregion, text)
Adding or customizing data tips
Creating interactive plots (click, hover, drag callbacks)
Animating or streaming data to a chart
Arranging multiple axes with tiledlayout/nexttile
Optimizing chart rendering performance
Exporting figures for publication or reports
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 --> BuildFast-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
Plan-Path Triggers (present plan first)
ANY of these fires the plan path:
Multi-panel / tiled figure
Custom interactivity (click, hover, drag callbacks)
Animation or streaming data
Performance-sensitive (large dataset, real-time update)
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 |
| Trend / time series | How does a value change over time? | plot, area, stackedplot, stairs, stem, fplot, fplot3 |
| Distribution | How is data spread? | histogram, histogram2, boxchart, violinplot, raincloudplot, swarmchart, swarmchart3, scatterhistogram, binscatter, polarhistogram |
| Relationship | How do variables relate? | scatter, scatter3, bubblechart, bubblechart3, plotmatrix, parallelplot, binscatter, spy, fimplicit |
| Composition | Parts of a whole? | piechart, donutchart, stacked bar, stacked area, wordcloud, bubblecloud |
Data-Domain Intents
| Intent | When it fires | Encouraged functions |
|---|---|---|
| Geospatial | Geographic coordinates | geoplot, geoscatter, geobubble, geodensityplot |
| Directional / polar | Angular, cyclical, compass data | polarplot, polarscatter, polarhistogram, polarbubblechart, compassplot, fpolarplot |
| Surfaces & scalar fields | z = f(x,y), meshes, contours | surf, surfc, surfl, mesh, meshc, meshz, ribbon, pcolor, contour, contourf, contour3, fcontour, fsurf, fmesh, fimplicit3, waterfall |
| Vector fields & flow | Directional vector data | quiver, quiver3, feather, streamline, streamslice, streamribbon, streamtube, streamparticles, coneplot |
| Volume visualization | 3D gridded volume data | slice, contourslice, coneplot, streamslice, isosurface/isocap workflows |
| Images & matrices | Display a matrix/grid | image, imagesc, heatmap, pcolor (flat), spy |
Classification Rules
The
waterfalltrap: MATLAB'swaterfallis a 3D surface plot, NOT the financial accumulation chart. For "accumulation to total," build frombarwith 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,comet3layer motion onto any chart type. Seereferences/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/donutchartare 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)notplot(x, y)MUST update data in place (
p.XData = newX) — never replot in a loopMUST use
drawnow limitratefor animations — never baredrawnowin tight loopsPREFER
tiledlayout/nexttileoversubplot()for multiple axesPREFER
exportgraphics()for publication-quality exportDo NOT close the figure after exporting unless the user asks — the user expects to see the plot in MATLAB
Additional constraints in uifigure apps
MUST use
uiaxes— never plainaxesMUST use
exportgraphics()orexportapp()—saveas/printnot supportedNEVER use
subplot()— not supported in uifigureNEVER use
annotation()— usetext(),xline(),yline(),xregion(),yregion()NEVER use
ginput()— useButtonDownFcnon plot objectsNEVER rely on
gcf/gca— uiaxes hasHandleVisibility = 'off'by default
Quick Start
Standalone figure
fig = figure;
ax = axes(fig);
t = 0:0.01:2*pi;
plot(ax, t, sin(t), 'LineWidth', 1.5);
hold(ax, 'on');
plot(ax, t, cos(t), '--', 'LineWidth', 1.5);
hold(ax, 'off');
title(ax, 'Sine and Cosine');
xlabel(ax, 'Time (s)');
ylabel(ax, 'Amplitude');
legend(ax, 'sin', 'cos');
grid(ax, 'on');
exportgraphics(ax, 'plot.png', 'Resolution', 300);In a uifigure app
fig = uifigure('Name', 'Chart Demo');
gl = uigridlayout(fig, [1 1]);
ax = uiaxes(gl);
plot(ax, t, sin(t), 'LineWidth', 1.5);
% Same API from here — only axes creation differsOnce you have ax, all plotting calls (plot, scatter, bar, xline, hold, legend, colororder, etc.) are identical regardless of context.
Implementation Checklist
Graphics
[ ] All plot calls pass
axas first argument[ ]
hold(ax, 'on')used before adding multiple series[ ] Axes labels, title, and grid configured
[ ] Annotations use
xline/yline/text(notannotation()— uifigure requirement)[ ] Interactive callbacks use
ButtonDownFcnon plot objects (not axes — uifigure requirement)[ ] Animations use
drawnow limitrateand pre-set axis limits[ ] Export uses
exportgraphics()(required in uifigure; preferred everywhere)[ ] Multiple axes use
tiledlayout/nexttile(required in uifigure; preferred everywhere)
Troubleshooting
Issues marked (uifigure only) apply only when plotting in uifigure apps.
| Problem | Cause | Fix |
|---|---|---|
| Animation is slow/jerky | Using plot() in loop or bare drawnow | Update data in place + drawnow limitrate |
| Plot disappears after replot | Default NextPlot = 'replacechildren' | Use hold(ax, 'on') or update data in place |
gcf/gca return wrong handle (uifigure only) | uiaxes HandleVisibility = 'off' | Always pass ax explicitly |
annotation() error (uifigure only) | Not supported in uifigure | Use text(), xline(), yline() |
ginput() error (uifigure only) | Not supported in uifigure | Use ButtonDownFcn on plot objects |
| Click callback doesn't fire on axes (uifigure only) | ButtonDownFcn unreliable on uiaxes | Put ButtonDownFcn on plot objects |
| Heatmap fails in uiaxes (uifigure only) | Heatmap needs figure/panel parent | Use heatmap(fig, ...) or heatmap(panel, ...) |
saveas fails (uifigure only) | Not supported for uifigure | Use exportgraphics(ax, file) |
subplot() errors (uifigure only) | Not supported in uifigure | Use tiledlayout/nexttile or uigridlayout |
References
| Topic | File | Coverage | Intent served |
|---|---|---|---|
| Plot types | references/plot-types.md | Line, scatter, bar, histogram, heatmap, surface | Comparison, Trend, Distribution, Relationship, Surfaces (partial) |
| Axes configuration | references/axes-config.md | uiaxes setup, labels, limits, ticks, font, legend, export | All intents |
| Annotations | references/annotations.md | xline, yline, xregion, text, patch | All intents (overlay) |
| Data tips | references/data-tips.md | DataTipTemplate, custom rows, programmatic tips | All intents (overlay) |
| Interactive plots | references/interactive-plots.md | ButtonDownFcn, mouse callbacks, drag, HitTest, toolbar | Plan-path: interactivity |
| Chart palettes | references/chart-palettes.md | colororder, named palettes, SeriesIndex, vs colormap | All intents (styling) |
| Animation | references/animation.md | Update in place, animatedline, streaming, performance | Plan-path: animation |
| Multiple axes | references/multiple-axes.md | tiledlayout, nexttile, linkaxes, peripheral tiles | Plan-path: multi-panel |
| Performance | references/performance.md | Lazy-load, batch updates, throttle, parfeval, startup | Plan-path: performance |
Reference Gaps (follow-up authoring needed)
These intents have no dedicated reference file. Use built-in MATLAB API knowledge:
Composition —
piechart,donutchart, stacked bar/area,wordcloud,bubblecloudGeospatial —
geoplot,geoscatter,geobubble,geodensityplotDirectional / polar —
polarplot,polarscatter,polarhistogram,polarbubblechart,compassplot,fpolarplotVector fields & flow —
quiver,quiver3,feather,streamline,streamslice,streamribbon,streamtube,streamparticles,coneplotVolume visualization —
slice,contourslice,coneplot, isosurface/isocap workflowsImages & matrices (partial) —
image,imagescnot covered;heatmapin plot-typesSurfaces (partial) — only
surfcovered;mesh,contour,ribbon,pcolorpending
External Skills (invoked, not read)
matlab-apply-theme— when the chart needs dark mode, brand colors, or custom palettes
Copyright 2026 The MathWorks, Inc.
Files
- ATTRIBUTION.mdAdded by AutoGineer1.0 KiB
- LICENSELicence file added by AutoGineer1.4 KiB
- SKILL.md13.7 KiB
- manifest.yaml523 B
- references/animation.md2.1 KiB
- references/annotations.md1.2 KiB
- references/axes-config.md2.2 KiB
- references/chart-palettes.md1.8 KiB
- references/data-tips.md976 B
- references/interactive-plots.md2.9 KiB
- references/multiple-axes.md2.4 KiB
- references/performance.md4.0 KiB
- references/plot-types.md2.4 KiB
manifest.yaml
# Copyright 2026 The MathWorks, Inc. # manifest.yaml — Tooling metadata for matlab-build-chart schema-version: 1 license: https://www.mathworks.com/content/dam/mathworks/license/pmrl/license.md scope: cross-product version: "1.3" human-description: Create and customize MATLAB charts with correct axes handling, modern layout, annotations, interactivity, and animation patterns. matlab-release: ">=R2025a" toolkit: matlab-agentic-toolkit required-products: [] optional-products: [] required-tools: [] required-skills: []
Requirements and compatibility
Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta
“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.
Security
No issues found by our static scan· No issues found
A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.
Attribution and licence
- Created by
- MathWorks
- Publisher
- MathWorks (Official)
- Source
- matlab/matlab-agentic-toolkit · skills-catalog/matlab-app-building/matlab-build-chart · commit 2a7f215
- Licence
- BSD 2-Clause License (redistribution allowed)
- LICENSE (added by AutoGineer from LICENSE.md)
- ATTRIBUTION.md (written by AutoGineer)
- Synced
AutoGineer is not affiliated with or endorsed by MathWorks or MathWorks.
Download ZIP
The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download matlab-build-chart.zip