An OpenClaw skill that generates publication-quality academic diagrams and statistical plots from text descriptions using PaperBanana.
Turn methodology descriptions into professional figures. Turn data into publication-ready plots. All from chat.
All figures below were generated by this skill from text prompts and JSON data:
| Architecture Diagram | Performance Comparison | Training Convergence |
|---|---|---|
![]() |
![]() |
![]() |
| gpt-5.2 + gpt-image-1.5 | gpt-5.2 + Matplotlib | gpt-5.2 + Matplotlib |
The full demo paper (demo/paper.pdf) was compiled from these figures with LaTeX.
- π Diagram Generation β Methodology figures, architecture diagrams, pipeline illustrations from text descriptions
- π Plot Generation β Bar charts, line plots, scatter plots from CSV/JSON data using Matplotlib code generation
- π Iterative Refinement β AI critic evaluates each iteration and provides feedback for improvement
- π Evaluation β Compare generated diagrams against human references (Faithfulness, Readability, Conciseness, Aesthetics)
- π§ Run Continuation β Refine previous generations with natural language feedback
- π€ Auto-Triggering β OpenClaw automatically invokes the skill when you ask to generate figures
| Provider | Env Var | Cost | Quality |
|---|---|---|---|
| Google Gemini | GOOGLE_API_KEY |
Paid/Free Tier | Best |
| OpenAI | OPENAI_API_KEY |
Paid | Great (gpt-5.2 + gpt-image-1.5) |
| OpenRouter | OPENROUTER_API_KEY |
Paid | Any model |
Auto-detection priority: Gemini β OpenAI β OpenRouter. Override with --provider.
cd /path/to/your/openclaw/workspace/skills
git clone https://github.com/GoatInAHat/openclaw-paperbanana.git paperbananaAdd to ~/.openclaw/openclaw.json:
{
skills: {
entries: {
"paperbanana": {
enabled: true,
env: {
// Pick one (or multiple for fallback):
// Google Gemini β free, good quality
GOOGLE_API_KEY: "AIzaSy...",
// OpenAI β paid, best quality
// OPENAI_API_KEY: "sk-...",
// OpenRouter β paid, access to any model
// OPENROUTER_API_KEY: "sk-or-...",
}
}
}
}
}The skill uses uv for zero-config dependency management. Install if needed:
curl -LsSf https://astral.sh/uv/install.sh | shThat's it. No pip install, no virtual environments β uv handles everything automatically on first run.
Once installed, OpenClaw will automatically invoke the skill when you ask to generate diagrams or plots. You can also call the scripts directly.
uv run scripts/generate.py \
--context "Our framework uses a three-stage pipeline: an encoder, attention module, and decoder..." \
--caption "Overview of the proposed architecture" \
--iterations 3From a file:
uv run scripts/generate.py \
--input method_section.txt \
--caption "System architecture overview"Options:
| Flag | Default | Description |
|---|---|---|
--iterations N |
3 | Refinement rounds |
--auto-refine |
off | Loop until critic is satisfied |
--provider |
auto | gemini, openai, or openrouter |
--format |
png | png, jpeg, or webp |
--no-optimize |
off | Disable input optimization |
uv run scripts/plot.py \
--data '{"Model":["A","B","C"],"Accuracy":[85.2,91.3,88.7]}' \
--intent "Bar chart comparing model accuracy"From CSV:
uv run scripts/plot.py \
--data-file results.csv \
--intent "Line plot showing loss over epochs"uv run scripts/evaluate.py \
--generated output.png \
--reference human_drawn.png \
--context "The methodology text..." \
--caption "Figure caption"# Continue the most recent run with feedback
uv run scripts/generate.py \
--continue \
--feedback "Make the arrows thicker and use more distinct colors"
# Continue a specific run
uv run scripts/generate.py \
--continue-run run_20260228_143022_a1b2c3 \
--feedback "Add labels to each component"PaperBanana uses a multi-agent pipeline:
Input Text β Retriever β Planner β Stylist β Visualizer β Critic
β β
β Feedback β
- Retriever β Finds relevant reference diagrams from the built-in example set
- Planner β Generates a detailed diagram description from your methodology text
- Stylist β Refines the description with academic styling guidelines
- Visualizer β Generates the diagram image (or Matplotlib code for plots)
- Critic β Evaluates the output and suggests improvements for the next iteration
For methodology diagrams, the Visualizer uses image generation models (DALL-E 3, gpt-image-1.5, or Gemini). For statistical plots, the Visualizer generates and executes Matplotlib code β producing true vector graphics.
Override default models via environment variables:
# OpenAI
OPENAI_VLM_MODEL=gpt-5.2 # Vision-Language Model for planning/critique
OPENAI_IMAGE_MODEL=gpt-image-1.5 # Image generation model
# Gemini
GEMINI_VLM_MODEL=gemini-2.0-flash
GEMINI_IMAGE_MODEL=gemini-2.0-flash-preview-image-generation
# OpenRouter
OPENROUTER_VLM_MODEL=google/gemini-2.0-flash-001
OPENROUTER_IMAGE_MODEL=google/gemini-2.0-flash-001This skill follows the OpenClaw AgentSkills format. When installed:
- Auto-triggering: OpenClaw reads the SKILL.md description and automatically invokes the skill when you ask to "generate a diagram", "create a figure", "make a plot", etc.
- Output delivery: Scripts print
MEDIA:/path/to/image.pngwhich OpenClaw auto-attaches to the chat response. - API key injection: Keys configured in
skills.entries.paperbanana.envare injected into the script environment automatically. - Zero-install deps:
uvwith PEP 723 inline script metadata handles all Python dependencies in isolated environments.
paperbanana/
βββ SKILL.md # OpenClaw skill definition (frontmatter + instructions)
βββ scripts/
β βββ generate.py # Diagram generation + run continuation
β βββ plot.py # Statistical plot generation
β βββ evaluate.py # Diagram quality evaluation
βββ references/
β βββ providers.md # Provider comparison + configuration reference
βββ demo/
β βββ paper.tex # Demo LaTeX paper
β βββ paper.pdf # Compiled demo paper
β βββ architecture.png # Generated architecture diagram
β βββ comparison.png # Generated bar chart
β βββ convergence.png # Generated line plot
βββ LICENSE # MIT
βββ README.md # This file
- OpenClaw (any version with skill support)
uvβ₯ 0.4 (install)- Python β₯ 3.10
- At least one API key (Gemini is free)
MIT β see LICENSE.


