MAGIC Agent Skills is now open source! Star on GitHub
MAGIC Agent SkillsMAGIC Agent Skills
Skills Reference

magic-data-visualization

Select appropriate chart types and generate publication-quality visualizations (PNG, SVG, interactive HTML). Use when creating charts, plotting distributions, comparing groups visually, visualizing correlations, or supporting findings with visuals. Covers bar, line, scatter, histogram, box, heatmap, and small multiples. Use after profiling or statistical analysis to communicate results.

When It Activates

Use this skill when creating charts or visual representations of data. Trigger phrases: chart, plot, visualize, histogram, bar chart, scatter, heatmap, box plot, dashboard, include a chart, show me a graph.

  • Need to visualize data distributions, comparisons, trends, or correlations
  • Need to select the right chart type for the data
  • Need publication-quality static or interactive charts
  • After magic-statistical-analysis, to support findings with visuals

When NOT to Use: Use magic-data-profiling for automated EDA reports; use magic-report-generation for assembling reports.

Quick Facts

PropertyValue
Version2.0.0
Complexitymedium
Phase1
Scripts3

Tags

data-science visualization charts plots matplotlib plotly

Scripts

Scriptable Tools (call directly or read + adapt)

ScriptStandard CLI UsageWhen to Customize
chart_selector.pypython3 chart_selector.py data.csv recommendations.json--relationship distribution|comparison|correlation|composition|trend|ranking to override auto-detection
generate_chart.pypython3 generate_chart.py data.csv chart.png--chart_type bar, --x_col, --y_col for explicit axes; --interactive --format html for Plotly output
validate_chart.pypython3 validate_chart.py data.csv chart_meta.json report.jsonRequires chart metadata JSON sidecar from generate_chart.py

New in v2.0.0

validate_chart.py — Chart Output Validation

validate_chart.py verifies chart output file existence and format conformance. It requires a chart metadata JSON sidecar produced by generate_chart.py alongside the chart file.

# After generating a chart
python3 generate_chart.py data.csv chart.png --chart_type bar --x_col region --y_col revenue

# Validate the output
python3 validate_chart.py data.csv chart_meta.json validation_report.json

chart_selector.py Score Field

chart_selector.py now returns a numeric score field (0–100) per recommendation, sorted by score. Use this to programmatically select the best chart type when building pipelines:

python3 chart_selector.py data.csv recommendations.json
# recommendations.json contains [{chart_type, x_col, y_col, score, reasoning}, ...]

Pass the top recommendation directly to generate_chart.py:

CHART_TYPE=$(jq -r '.[0].chart_type' recommendations.json)
X_COL=$(jq -r '.[0].x_col' recommendations.json)
Y_COL=$(jq -r '.[0].y_col' recommendations.json)
python3 generate_chart.py data.csv chart.png --chart_type $CHART_TYPE --x_col $X_COL --y_col $Y_COL

Dependencies

pandas matplotlib seaborn plotly

Was this page helpful?
Edit on GitHub

Last updated on

On this page