skill

Data Visualization

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.

Anthropic4.80+ installsVetted

About

# 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',

Install

Run this command

git clone https://github.com/anthropics/knowledge-work-plugins && cp -r knowledge-work-plugins/data/skills/data-visualization ~/.claude/skills/

Works with

claude appclaude codeclaude apicursorcodexwindsurfclinezed

Manual steps

Clone the repository and copy the `data/skills/data-visualization` folder into your Claude skills directory. Compatible with Claude Code, Cursor, Codex, and any Agent Skills-compatible agent.

View source
License: Apache-2.0By Anthropic

Frequently asked questions

What is the Data Visualization skill?

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.

How do I install Data Visualization?

Run this in your terminal:

git clone https://github.com/anthropics/knowledge-work-plugins && cp -r knowledge-work-plugins/data/skills/data-visualization ~/.claude/skills/
Which AI tools does Data Visualization work with?

It works with claude_app, claude_code, claude_api, cursor, codex, windsurf, cline, zed.

Who made Data Visualization?

Anthropic, released under the Apache-2.0 license.

Is Data Visualization free?

Yes, it is free to use under the Apache-2.0 license.

Related assets

More curated picks in Data & Analytics.

All Data Visualization alternatives →
skillclaude_appclaude_codeclaude_api
npx skills add google/agents-cli
Google Agents Cli Observability
This skill should be used when the user wants to "set up tracing", "monitor my agent", "configure logging", "add observability", "debug production tra…357,631+
skillclaude_appclaude_codeclaude_api
npx skills add prisma/skills
Prisma Driver Adapter Implementation
Required reference for Prisma ORM 7 SQL driver adapter work. Use when implementing or modifying adapters, adding database drivers, or touching SqlDriv…300,037+
skillclaude_appclaude_codeclaude_api
npx skills add neondatabase/agent-skills
Neon Postgres
Guides and best practices for working with Lakebase Postgres on Neon: connections, pooled vs direct, schema migrations, branching, autoscaling, scale-…187,765+
skillclaude_appclaude_codeclaude_api
npx skills add firebase/agent-skills
Firebase Basics
Provides foundational Firebase CLI setup, CLI installation, version checks (`firebase-tools@latest --version`), CLI login (including --no-localhost),…158,802+
skillclaude_appclaude_codeclaude_api
npx skills add firebase/agent-skills
Firebase Auth Basics
Guide for setting up and using Firebase Authentication. Use this skill when the user's app requires user sign-in, user management, or secure data acce…157,711+
skillclaude_appclaude_codeclaude_api
npx skills add firebase/agent-skills
Firebase Hosting Basics
Deploys and configures classic Firebase Hosting for static websites, single-page apps (SPAs), and microservices. Use when deploying static sites/SPAs,…153,880+

Audit before you install

Run any source through our checks - AI visibility, security, performance, and stack detection.

More in Data & Analytics