chart-rendering

Generate matplotlib charts from tidy analysis results as PNG images with reproducible scripts.

5.4k|1.3k|Updated Sep 23, 2025
One-click install
npx skills add https://github.com/agentscope-ai/agentscope-java --skill chart-rendering
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: chart-rendering
Source: https://github.com/agentscope-ai/agentscope-java/tree/main/agentscope-examples/agents/agentscope-dataagent/src/main/resources/shared/agents/data-agent/skills/chart-rendering
Command: npx skills add https://github.com/agentscope-ai/agentscope-java --skill chart-rendering

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires matplotlib, pandas.

What problem does it solve?

Turning a query result into a chart that actually communicates the answer requires consistent decisions about chart type, labeling, and reproducibility, which ad-hoc plotting often gets wrong.

Core Features & Use Cases

  • Chart Type Selection: Maps the question shape (trend, composition, comparison, relationship, distribution) to the right chart type such as line, bar, scatter, or area.
  • Reproducible Rendering: Writes a matplotlib script under scratch/charts, executes it via shell_run, and saves a labeled PNG at 150 dpi under knowledge/charts.
  • Interpretation and Iteration: Embeds the image with 2-3 sentences of interpretation and edits the saved script for tweaks instead of regenerating from scratch.
  • Use Case: After running a SQL analysis of weekly active users, ask for a trend chart and receive a labeled line chart PNG plus the script that generated it.

Quick Start

Plot the trend of weekly active users from the last query result as a line chart with labeled axes.

Frequently Asked Questions about chart-rendering

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

FAQPage Schema
How do I choose the right chart type for my data?

Match the chart to the question shape: line charts for trends over time, stacked bar or area for composition, bar for category comparison, scatter for relationships between two numeric variables, and histogram or box plot for distributions. If none fit, ask the user which view they want.

How to render a matplotlib chart from SQL query results?

First ensure the result is tidy with one row per data point, reshaping with pandas pivot, melt, or groupby if needed. Then write a matplotlib script to a file, execute it via shell_run, and save the output as a PNG with bbox_inches tight and dpi 150.

Can I modify a chart after it has been generated?

Yes, edit the saved script under scratch/charts and re-run it rather than regenerating from scratch. The script is the source of truth, so tweaks like switching to a log y-axis are applied by modifying and re-executing it.

When should I not use this charting approach?

Avoid pie charts with more than five slices, charting raw counts when proportions were requested, and charts without labeled axes or units. For multi-chart dashboards with narrative, delegate to a report-writer sub-agent instead.

What data format does matplotlib charting expect?

The input should be a tidy data frame with one row per data point and one column per dimension, typically produced by an upstream SQL analysis step. Untidy data must be reshaped with pandas before rendering.