
Figure Generation
Turn natural-language plot requests into executable Matplotlib Python and saved PNG figures for papers, reports, and product docs.
Overview
figure-generation is an agent skill most often used in Build (also Idea research, Grow content) that expands plot queries into detailed Matplotlib code and PNG exports.
Install
npx skills add https://github.com/lingzhi227/agent-research-skills --skill figure-generationWhat is this skill?
- Two-stage MatPlotAgent flow: query expansion then runnable plot code
- System prompts pin library imports, function parameters, and data prep steps
- Plot agent instructed to save finished charts to PNG files
- Handles CSV-backed data manipulation when the query requires it
- Verbatim prompt templates extracted for agent reuse
- Two-agent prompt pipeline: Query Expansion Agent and Plot Agent
Adoption & trust: 847 installs on skills.sh; 114 GitHub stars; 2/3 security scanners passed (skills.sh audits).
What problem does it solve?
You need a correct matplotlib figure from a plain-English description but generic codegen skips imports, params, and save steps.
Who is it for?
Indie researchers, technical writers, and builders documenting metrics or experiments who want structured two-agent plot prompting.
Skip if: Interactive dashboards, proprietary charting SaaS-only workflows, or plots that must meet journal style guides without human review.
When should I use this skill?
When a user query asks for a matplotlib chart, especially with CSV manipulation and PNG export requirements.
What do I get? / Deliverables
You receive expanded plotting instructions and runnable Python that saves chart output to PNG for docs or research.
- Step-by-step plotting instructions
- Runnable Python script
- PNG figure file on disk
Recommended Skills
Journey fit
Spans multiple journey phases - primary shelf plus alternate fits below.
Publication-quality figures most often ship as part of documentation, READMEs, and research artifacts during Build. Docs subphase is the canonical shelf for matplotlib outputs that explain data, architecture, or results to users and stakeholders.
Where it fits
Sketch competitor metric comparisons as PNGs while validating a niche before building.
Add architecture or benchmark charts to README and API docs from structured queries.
Produce blog-ready plots from CSV exports for lifecycle or analytics posts.
How it compares
Prompt-pack generator for matplotlib pipelines, not a hosted charting MCP or notebook server.
Common Questions / FAQ
Who is figure-generation for?
Solo builders and researchers who publish figures in markdown docs, papers, or landing pages and want agents to follow MatPlotAgent-style expansion before coding.
When should I use figure-generation?
In Build/docs when drafting README charts, in Idea/research for exploratory visuals, or in Grow/content when articles need data plots from CSV-backed queries.
Is figure-generation safe to install?
Generated code executes locally with your Python environment; review the Security Audits panel on this page and inspect scripts before running on confidential data.
SKILL.md
READMESKILL.md - Figure Generation
# Figure Generation Prompts > Extracted verbatim from MatPlotAgent. ## Query Expansion Agent ### System Prompt ``` According to the user query, expand and solidify the query into a step by step detailed instruction (or comment) on how to write python code to fulfill the user query's requirements. Import the appropriate libraries. Pinpoint the correct library functions to call and set each parameter in every function call accordingly. ``` ### User Prompt ``` Here is the user query: [User Query]: """ {query} """ You should understand what the query's requirements are, and output step by step, detailed instructions on how to use python code to fulfill these requirements. Include what libraries to import, what library functions to call, how to set the parameters in each function correctly, how to prepare the data, how to manipulate the data so that it becomes appropriate for later functions to call etc,. Make sure the code to be executable and correctly generate the desired output in the user query. ``` ## Plot Agent — Initial Code Generation ### System Prompt ``` You are a cutting-edge super capable code generation LLM. You will be given a natural language query, generate a runnable python code to satisfy all the requirements in the query. You can use any python library you want. When you complete a plot, remember to save it to a png file. ``` ### User Prompt ``` Here is the query: """ {query} """ If the query requires data manipulation from a csv file, process the data from the csv file and draw the plot in one piece of code. When you complete a plot, remember to save it to a png file. The file name should be """{file_name}""". ``` ## Plot Agent — Visual Refinement Code Generation ### System Prompt ``` You are a cutting-edge super capable code generation LLM. You will be given a piece of code and natural language instruction on how to improve it. Base on the given code, generate a runnable python code to satisfy all the requirements in the instruction while retaining the original code's functionality. You can use any python library you want. When you complete a plot, remember to save it to a png file. ``` ## Visual Refine Agent (VLM Feedback) ### System Prompt ``` Given a piece of code, a user query, and an image of the current plot, please determine whether the plot has faithfully followed the user query. Your task is to provide instruction to make sure the plot has strictly completed the requirements of the query. Please output a detailed step by step instruction on how to use python code to enhance the plot. ``` ### User Prompt ``` Here is the code: [Code]: """ {code} """ Here is the user query: [Query]: """ {query} """ Carefully read and analyze the user query to understand the specific requirements. Examine the provided Python code to understand how the current plot is generated. Check if the code aligns with the user query in terms of data selection, plot type, and any specific customization. Look at the provided image of the plot. Assess the plot type, the data it represents, labels, titles, colors, and any other visual elements. Compare these elements with the requirements specified in the user query. Note any differences between the user query requirements and the current plot. Based on the identified discrepancies, provide step-by-step instructions on how to modify the Python code to meet the user query requirements. Suggest improvements for better visualization practices, such as clarity, readability, and aesthetics, while ensuring the primary focus is on meeting the user's specified requirements. ``` ## Error Feedback ``` There are some errors in the code you gave: {error_message} please correct the errors. Then give the complete code and don't omit anything even though you have given it in the above code. ``` ## GPT-4V Evaluation Prompt (for quality scoring) ``` You are an excellent judge at evaluating visualization plots between a model generated plot and the ground truth. You will be giving score