matlab-build-chart

Create and customize MATLAB charts with axes configuration, annotations, interactivity, and animation.

995|122|Updated Apr 3, 2026
One-click install
npx skills add https://github.com/matlab/matlab-agentic-toolkit --skill matlab-build-chart
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: matlab-build-chart
Source: https://github.com/matlab/matlab-agentic-toolkit/tree/main/skills-catalog/matlab-app-building/matlab-build-chart
Command: npx skills add https://github.com/matlab/matlab-agentic-toolkit --skill matlab-build-chart

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Building correct MATLAB visualizations requires knowing dozens of context-specific rules: uifigure apps reject subplot, annotation, ginput, and saveas, animations need in-place data updates instead of replotting, and choosing the right chart type for a data question is non-obvious. This Skill encodes those rules so charts work correctly in standalone figures, Live Scripts, and uifigure apps on the first attempt.

Core Features & Use Cases

  • Intent-based chart selection: Maps data questions (comparison, trend, distribution, relationship, composition, geospatial, polar, surfaces, vector fields, volume) to the right MATLAB plotting functions.
  • Context-aware constraints: Applies universal rules plus uifigure-specific restrictions (uiaxes only, exportgraphics instead of saveas, ButtonDownFcn instead of ginput).
  • Interactivity and animation patterns: Provides reference implementations for click/drag callbacks, data tips, streaming with animatedline, and drawnow limitrate performance optimization.
  • Use Case: A user asks to visualize streaming sensor data in an app. The Skill selects animatedline, creates a uiaxes inside uigridlayout, sets axis limits before the loop, and uses drawnow limitrate for smooth 20 fps updates.

Quick Start

Ask the agent to plot your data in MATLAB, for example: create an animated line chart of streaming sensor data inside a uifigure app with proper axes labels and export it to PNG.

Frequently Asked Questions about matlab-build-chart

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create plots in a MATLAB uifigure app?

Create a uiaxes inside a uigridlayout within the uifigure, then pass the axes handle as the first argument to plotting functions like plot(ax, x, y). Standard axes, subplot, annotation, and ginput are not supported in uifigure.

How do I animate a MATLAB plot without it being slow?

Create the plot object once and update its XData and YData properties in the loop instead of calling plot repeatedly. Use drawnow limitrate to cap updates around 20 fps and set axis limits before the loop to skip auto-limit recalculation.

What is the difference between tiledlayout and subplot in MATLAB?

tiledlayout with nexttile is the modern approach supporting shared titles, linked axes, and compact spacing, and it works in uifigure apps. subplot does not work reliably in uifigure and should be avoided.

Why does saveas fail when exporting a uifigure?

saveas and print are not supported for uifigure windows. Use exportgraphics(ax, file) to export individual axes or exportapp(fig, file) to capture the entire app window.

How do I add click callbacks to a MATLAB chart in uifigure?

Set ButtonDownFcn on the plot objects themselves, such as lines or scatter points, rather than on the uiaxes, where it is unreliable. The event provides IntersectionPoint with data coordinates of the click.

When should I not use this chart-building skill?

Do not use it for building full apps (use matlab-build-app), applying dark mode or brand color themes (use matlab-apply-theme), working with Simulink scopes, or creating App Designer charts through the drag-and-drop GUI.