Agent Skill
Data visualisation (Anthropic)
Background chart knowledge the agent loads on its own: which chart fits the data, matplotlib, seaborn and plotly patterns, accessible colour and a checklist.
Bookmark
Bookmarks are kept in your free account, so you can find this page again on any device.
Sign in to bookmarkInstall
Commands are pinned to commit 5e504ae, the version we read, wherever the install method supports it.
npx skills
npx skills add anthropics/knowledge-work-plugins@5e504ae11498f2b8daa30d86b7dab97b2ecd8092 --skill data-visualization -a claude-codeCopies the skill into .claude/skills/ in this project, pinned to the reviewed commit.
Plugin marketplace
/plugin marketplace add anthropics/knowledge-work-plugins
/plugin install data@knowledge-work-pluginsRun inside Claude Code. Installs the whole data plugin, including the /create-viz command that uses this skill's subject, from its default branch, not the pinned commit.
npx skills
npx skills add anthropics/knowledge-work-plugins@5e504ae11498f2b8daa30d86b7dab97b2ecd8092 --skill data-visualization -a codexInstalls to .agents/skills/, which Codex scans from the working directory up to the repo root.
npx skills
npx skills add anthropics/knowledge-work-plugins@5e504ae11498f2b8daa30d86b7dab97b2ecd8092 --skill data-visualization -a cursorInstalls to .agents/skills/, one of the folders Cursor reads skills from.
gh skill
gh skill install anthropics/knowledge-work-plugins data/skills/data-visualization --pin 5e504ae11498f2b8daa30d86b7dab97b2ecd8092 --agent github-copilotNeeds GitHub CLI 2.90.0 or later. Use --scope user to install for every repository.
npx skills
npx skills add anthropics/knowledge-work-plugins@5e504ae11498f2b8daa30d86b7dab97b2ecd8092 --skill data-visualizationPinned to the commit we reviewed. The CLI asks which agents to install for; add -g to install for your user instead of this project.
What it does
It is reference material, not a procedure: the agent reads it when you ask for a chart, and uses it to choose and build one. It opens with a table that maps what you are showing to a chart (trend over time to a line chart, ranking to a horizontal bar, distribution to a histogram, correlation across many variables to a heatmap) and a list of charts to avoid: pies with six or more slices, anything 3D, careless dual axes. Then come working Python patterns for a line chart, a sorted bar chart with value labels, a histogram with mean and median lines, a heatmap and small multiples, number formatters for currency and percentages, and two plotly examples for interactive output.
The last third is design and accessibility: titles that state the finding (“Revenue grew 23% YoY”, not “Revenue by Month”), bars that start at zero, the same scale across panels, never relying on colour alone, alt text and a data table for screen readers, and a six-point checklist to run before sharing.
What user-invocable: false means
The frontmatter sets user-invocable: false. It is not in the open spec, and each agent treats it differently:
| Agent | Effect, checked 25 November 2026 |
|---|---|
| Claude Code | Hidden from the / menu, and typing /data-visualization does not run it. Claude still loads it when a request matches the description. |
| GitHub Copilot (VS Code) | Hidden from the / menu; the agent can still load it automatically. |
| Cursor | Not a documented field. Expect it to be ignored, so the skill also appears as /data-visualization. |
| Codex | Codex reads only name and description from SKILL.md, so the skill shows in the $ picker like any other. |
In practice this is the right setting for a skill like this one. You do not want to “run” a chart style guide; you want it in the background when you ask for a chart. In Claude Code with the plugin installed, /data:create-viz is the command, and this skill supplies the knowledge.
When to use it
Analysts and anyone else who asks an agent for charts in Python, for a report, a notebook or a deck, and is tired of defaults: unsorted bars, rotated axis labels, a legend over the data, a title that says nothing. It pairs naturally with explore data before the chart and validate data before the result goes to stakeholders. Teams with a house style can copy it and swap in their own palette and fonts.
When to skip it
When your charts are not made in Python: a BI tool, Excel, or a JavaScript library for a web page. The principles carry over but the code does not. And check its colours before you rely on the “colorblind-friendly” label. The hex list under that comment (#4C72B0, #DD8452, #55A868, #C44E52 and two more) is seaborn’s “deep” palette, which puts a green and a red side by side; we confirmed the values against seaborn 0.13.2. Seaborn’s actual “colorblind” palette, which the skill recommends further down, starts #0173B2, #DE8F05, #029E73. Ask for that one by name.
Try it
Here's monthly revenue by region for 2026 in sales.csv. Make one chart
for the board pack that shows which region grew fastest, readable in
black and white, with the takeaway as the title and alt text I can paste
into the slide.
What it can touch
- Bundles scripts
- No
- Pre-approved tools
- None declared
- Needs
- Python with pandas, matplotlib and seaborn; plotly for the interactive examples
- Client-specific fields
- user-invocable
- Files
- At commit
5e504aethe SKILL.md is 305 lines long, and it is the only file in the folder. It is part of Anthropic’sdataplugin, whose other skills include explore data, validate data, build dashboard and acreate-vizskill you call as a command.
claude.ai and the Claude API reject uploads that use fields outside the open spec or names containing "claude" or "anthropic", so this skill needs editing before you upload it there.
Its instructions steer what your agent does, and it may have changed since the commit we read. How to check a skill.
Instructions only: no scripts, no allowed-tools, no network. Following it, the agent writes and runs Python in your environment, which needs pandas, matplotlib and seaborn (and plotly for interactive charts), and saves PNG files such as trend_chart.png in the working directory. user-invocable is the only non-portable field; the Claude apps upload rejects it, so there is no upload command.
Alternatives
Build dashboard from the same plugin produces a self-contained HTML dashboard when one chart is not enough. Statistical analysis covers the tests and intervals behind a chart that makes a claim. For the whole path from question to shared chart, see the SQL questions to dashboard workflow.
SKILL.md
The file exactly as published at the reviewed commit, reproduced under its Apache-2.0 licence.
---
name: data-visualization
description: Create effective data visualizations with Python (matplotlib, seaborn, plotly). Use when building charts, choosing the right chart type for a dataset, creating publication-quality figures, or applying design principles like accessibility and color theory.
user-invocable: false
---
# Data Visualization Skill
Chart selection guidance, Python visualization code patterns, design principles, and accessibility considerations for creating effective data visualizations.
## Chart Selection Guide
### Choose by Data Relationship
| What You're Showing | Best Chart | Alternatives |
|---|---|---|
| **Trend over time** | Line chart | Area chart (if showing cumulative or composition) |
| **Comparison across categories** | Vertical bar chart | Horizontal bar (many categories), lollipop chart |
| **Ranking** | Horizontal bar chart | Dot plot, slope chart (comparing two periods) |
| **Part-to-whole composition** | Stacked bar chart | Treemap (hierarchical), waffle chart |
| **Composition over time** | Stacked area chart | 100% stacked bar (for proportion focus) |
| **Distribution** | Histogram | Box plot (comparing groups), violin plot, strip plot |
| **Correlation (2 variables)** | Scatter plot | Bubble chart (add 3rd variable as size) |
| **Correlation (many variables)** | Heatmap (correlation matrix) | Pair plot |
| **Geographic patterns** | Choropleth map | Bubble map, hex map |
| **Flow / process** | Sankey diagram | Funnel chart (sequential stages) |
| **Relationship network** | Network graph | Chord diagram |
| **Performance vs. target** | Bullet chart | Gauge (single KPI only) |
| **Multiple KPIs at once** | Small multiples | Dashboard with separate charts |
### When NOT to Use Certain Charts
- **Pie charts**: Avoid unless <6 categories and exact proportions matter less than rough comparison. Humans are bad at comparing angles. Use bar charts instead.
- **3D charts**: Never. They distort perception and add no information.
- **Dual-axis charts**: Use cautiously. They can mislead by implying correlation. Clearly label both axes if used.
- **Stacked bar (many categories)**: Hard to compare middle segments. Use small multiples or grouped bars instead.
- **Donut charts**: Slightly better than pie charts but same fundamental issues. Use for single KPI display at most.
## Python Visualization Code Patterns
### Setup and Style
```python
import matplotlib.pyplot as plt
import matplotlib.ticker as mticker
import seaborn as sns
import pandas as pd
import numpy as np
# Professional style setup
plt.style.use('seaborn-v0_8-whitegrid')
plt.rcParams.update({
'figure.figsize': (10, 6),
'figure.dpi': 150,
'font.size': 11,
'axes.titlesize': 14,
'axes.titleweight': 'bold',
'axes.labelsize': 11,
'xtick.labelsize': 10,
'ytick.labelsize': 10,
'legend.fontsize': 10,
'figure.titlesize': 16,
})
# Colorblind-friendly palettes
PALETTE_CATEGORICAL = ['#4C72B0', '#DD8452', '#55A868', '#C44E52', '#8172B3', '#937860']
PALETTE_SEQUENTIAL = 'YlOrRd'
PALETTE_DIVERGING = 'RdBu_r'
```
### Line Chart (Time Series)
```python
fig, ax = plt.subplots(figsize=(10, 6))
for label, group in df.groupby('category'):
ax.plot(group['date'], group['value'], label=label, linewidth=2)
ax.set_title('Metric Trend by Category', fontweight='bold')
ax.set_xlabel('Date')
ax.set_ylabel('Value')
ax.legend(loc='upper left', frameon=True)
ax.spines['top'].set_visible(False)
ax.spines['right'].set_visible(False)
# Format dates on x-axis
fig.autofmt_xdate()
plt.tight_layout()
plt.savefig('trend_chart.png', dpi=150, bbox_inches='tight')
```
### Bar Chart (Comparison)
```python
fig, ax = plt.subplots(figsize=(10, 6))
# Sort by value for easy reading
df_sorted = df.sort_values('metric', ascending=True)
bars = ax.barh(df_sorted['category'], df_sorted['metric'], color=PALETTE_CATEGORICAL[0])
# Add value labels
for bar in bars:
width = bar.get_width()
ax.text(width + 0.5, bar.get_y() + bar.get_height()/2,
f'{width:,.0f}', ha='left', va='center', fontsize=10)
ax.set_title('Metric by Category (Ranked)', fontweight='bold')
ax.set_xlabel('Metric Value')
ax.spines['top'].set_visible(False)
ax.spines['right'].set_visible(False)
plt.tight_layout()
plt.savefig('bar_chart.png', dpi=150, bbox_inches='tight')
```
### Histogram (Distribution)
```python
fig, ax = plt.subplots(figsize=(10, 6))
ax.hist(df['value'], bins=30, color=PALETTE_CATEGORICAL[0], edgecolor='white', alpha=0.8)
# Add mean and median lines
mean_val = df['value'].mean()
median_val = df['value'].median()
ax.axvline(mean_val, color='red', linestyle='--', linewidth=1.5, label=f'Mean: {mean_val:,.1f}')
ax.axvline(median_val, color='green', linestyle='--', linewidth=1.5, label=f'Median: {median_val:,.1f}')
ax.set_title('Distribution of Values', fontweight='bold')
ax.set_xlabel('Value')
ax.set_ylabel('Frequency')
ax.legend()
ax.spines['top'].set_visible(False)
ax.spines['right'].set_visible(False)
plt.tight_layout()
plt.savefig('histogram.png', dpi=150, bbox_inches='tight')
```
### Heatmap
```python
fig, ax = plt.subplots(figsize=(10, 8))
# Pivot data for heatmap format
pivot = df.pivot_table(index='row_dim', columns='col_dim', values='metric', aggfunc='sum')
sns.heatmap(pivot, annot=True, fmt=',.0f', cmap='YlOrRd',
linewidths=0.5, ax=ax, cbar_kws={'label': 'Metric Value'})
ax.set_title('Metric by Row Dimension and Column Dimension', fontweight='bold')
ax.set_xlabel('Column Dimension')
ax.set_ylabel('Row Dimension')
plt.tight_layout()
plt.savefig('heatmap.png', dpi=150, bbox_inches='tight')
```
### Small Multiples
```python
categories = df['category'].unique()
n_cats = len(categories)
n_cols = min(3, n_cats)
n_rows = (n_cats + n_cols - 1) // n_cols
fig, axes = plt.subplots(n_rows, n_cols, figsize=(5*n_cols, 4*n_rows), sharex=True, sharey=True)
axes = axes.flatten() if n_cats > 1 else [axes]
for i, cat in enumerate(categories):
ax = axes[i]
subset = df[df['category'] == cat]
ax.plot(subset['date'], subset['value'], color=PALETTE_CATEGORICAL[i % len(PALETTE_CATEGORICAL)])
ax.set_title(cat, fontsize=12)
ax.spines['top'].set_visible(False)
ax.spines['right'].set_visible(False)
# Hide empty subplots
for j in range(i+1, len(axes)):
axes[j].set_visible(False)
fig.suptitle('Trends by Category', fontsize=14, fontweight='bold', y=1.02)
plt.tight_layout()
plt.savefig('small_multiples.png', dpi=150, bbox_inches='tight')
```
### Number Formatting Helpers
```python
def format_number(val, format_type='number'):
"""Format numbers for chart labels."""
if format_type == 'currency':
if abs(val) >= 1e9:
return f'${val/1e9:.1f}B'
elif abs(val) >= 1e6:
return f'${val/1e6:.1f}M'
elif abs(val) >= 1e3:
return f'${val/1e3:.1f}K'
else:
return f'${val:,.0f}'
elif format_type == 'percent':
return f'{val:.1f}%'
elif format_type == 'number':
if abs(val) >= 1e9:
return f'{val/1e9:.1f}B'
elif abs(val) >= 1e6:
return f'{val/1e6:.1f}M'
elif abs(val) >= 1e3:
return f'{val/1e3:.1f}K'
else:
return f'{val:,.0f}'
return str(val)
# Usage with axis formatter
ax.yaxis.set_major_formatter(mticker.FuncFormatter(lambda x, p: format_number(x, 'currency')))
```
### Interactive Charts with Plotly
```python
import plotly.express as px
import plotly.graph_objects as go
# Simple interactive line chart
fig = px.line(df, x='date', y='value', color='category',
title='Interactive Metric Trend',
labels={'value': 'Metric Value', 'date': 'Date'})
fig.update_layout(hovermode='x unified')
fig.write_html('interactive_chart.html')
fig.show()
# Interactive scatter with hover data
fig = px.scatter(df, x='metric_a', y='metric_b', color='category',
size='size_metric', hover_data=['name', 'detail_field'],
title='Correlation Analysis')
fig.show()
```
## Design Principles
### Color
- **Use color purposefully**: Color should encode data, not decorate
- **Highlight the story**: Use a bright accent color for the key insight; grey everything else
- **Sequential data**: Use a single-hue gradient (light to dark) for ordered values
- **Diverging data**: Use a two-hue gradient with neutral midpoint for data with a meaningful center
- **Categorical data**: Use distinct hues, maximum 6-8 before it gets confusing
- **Avoid red/green only**: 8% of men are red-green colorblind. Use blue/orange as primary pair
### Typography
- **Title states the insight**: "Revenue grew 23% YoY" beats "Revenue by Month"
- **Subtitle adds context**: Date range, filters applied, data source
- **Axis labels are readable**: Never rotated 90 degrees if avoidable. Shorten or wrap instead
- **Data labels add precision**: Use on key points, not every single bar
- **Annotation highlights**: Call out specific points with text annotations
### Layout
- **Reduce chart junk**: Remove gridlines, borders, backgrounds that don't carry information
- **Sort meaningfully**: Categories sorted by value (not alphabetically) unless there's a natural order (months, stages)
- **Appropriate aspect ratio**: Time series wider than tall (3:1 to 2:1); comparisons can be squarer
- **White space is good**: Don't cram charts together. Give each visualization room to breathe
### Accuracy
- **Bar charts start at zero**: Always. A bar from 95 to 100 exaggerates a 5% difference
- **Line charts can have non-zero baselines**: When the range of variation is meaningful
- **Consistent scales across panels**: When comparing multiple charts, use the same axis range
- **Show uncertainty**: Error bars, confidence intervals, or ranges when data is uncertain
- **Label your axes**: Never make the reader guess what the numbers mean
## Accessibility Considerations
### Color Blindness
- Never rely on color alone to distinguish data series
- Add pattern fills, different line styles (solid, dashed, dotted), or direct labels
- Test with a colorblind simulator (e.g., Coblis, Sim Daltonism)
- Use the colorblind-friendly palette: `sns.color_palette("colorblind")`
### Screen Readers
- Include alt text describing the chart's key finding
- Provide a data table alternative alongside the visualization
- Use semantic titles and labels
### General Accessibility
- Sufficient contrast between data elements and background
- Text size minimum 10pt for labels, 12pt for titles
- Avoid conveying information only through spatial position (add labels)
- Consider printing: does the chart work in black and white?
### Accessibility Checklist
Before sharing a visualization:
- [ ] Chart works without color (patterns, labels, or line styles differentiate series)
- [ ] Text is readable at standard zoom level
- [ ] Title describes the insight, not just the data
- [ ] Axes are labeled with units
- [ ] Legend is clear and positioned without obscuring data
- [ ] Data source and date range are notedRelated skills
Explore data (Anthropic)
Profiles a new table or file before you analyse it: row counts, null rates, distributions, duplicates and suspect values, then suggests what to look at.
Validate data (Anthropic)
Reviews an analysis before it goes to stakeholders: method, joins, denominators, chart axes and conclusions, ending with ready, share with caveats or revise.
Build dashboard (Anthropic)
Anthropic's skill that builds a single-file HTML dashboard with KPI cards, Chart.js charts, filters and a sortable table from query results or a dataset.
Guides and recipes that use Data visualisation (Anthropic)
- From business question to SQL dashboard with AI
The assistant writes the SQL, you define the metrics and check every number before anyone acts.