academic-figures

Generate publication-quality academic figures from data with one command. Supports 7 chart types (bar, heatmap, scatter, line, box, forest, violin), 4 color themes (Nature, Lancet, conservative, default), CJK/Chinese auto-detection with zero garbled text, bilingual labels, statistical annotations (error bars, significance markers, trend lines, CI bands), and dual output (PNG 300dpi + SVG). Use when creating charts, plots, or figures for papers, presentations, or reports. Triggers on: "make a figure", "generate chart", "plot data", "create bar chart", "heatmap", "scatter plot", "forest plot", "box plot", "line chart", "violin plot", "论文配图", "画图", "柱状图", "热力图", "散点图", "森林图", "箱线图", "折线图".

Safety Notice

This listing is from the official public ClawHub registry. Review SKILL.md and referenced scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "academic-figures" with this command: npx skills add docsor1212/academic-figures

Academic Figures — Publication-Quality Chart Generator

Generate figures from JSON/CSV data. Local execution, no data leaves the machine.

Quick Start

# Bar chart with CJK support
python3 scripts/gen_figure.py -t bar -d data.json -o figure.png --cjk \
  --title "图2 主标题 / Subtitle" --ylabel "准确率 Accuracy (%)"

# Heatmap
python3 scripts/gen_figure.py -t heatmap -d data.json -o heatmap.png --cjk \
  --cmap RdBu_r --vmin -20 --vmax 45

# Scatter with trend line
python3 scripts/gen_figure.py -t scatter -d data.csv -o scatter.png \
  --xlabel "Baseline (%)" --ylabel "Gain (%)" --theme nature

Chart Types

TypeCommandKey Features
Bar-t barGrouped bars, error bars, significance brackets
Heatmap-t heatmapCell annotations, custom colormap, colorbar
Scatter-t scatterTrend line, r value, color grouping, mean points
Line-t lineMultiple series, error bands, markers
Box-t boxBox-and-whisker, jitter points
Forest-t forestCI whiskers, overall diamond, ref line
Violin-t violinDensity estimation, inner mean/median

Color Themes

  • --theme nature — Nature journal palette (vibrant, distinct)
  • --theme lancet — Lancet medical palette (bold, high-contrast)
  • --theme conservative — Professional muted (safe for any field)
  • --theme default — Balanced, versatile

CJK / Chinese Support

Pass --cjk to auto-detect and load system CJK fonts. Zero manual configuration needed.

python3 scripts/gen_figure.py -t bar -d data.json -o fig.png --cjk

Font detection priority: Noto Sans CJK → PingFang → Microsoft YaHei → WQY → AR PL → Droid.

For custom font: --cjk-font /path/to/font.ttf

Data Input

JSON (full features) or CSV (basic). See references/data-formats.md for complete schema per chart type.

JSON bar chart example:

{
  "labels": ["Group A", "Group B"],
  "series": {"Treatment": [75, 82], "Control": [68, 70]},
  "errors": {"Treatment": [3, 2], "Control": [2, 1]},
  "significance": {"Treatment:0": "***", "Control:1": "NS"}
}

Key Flags

FlagDescription
--title "text"Figure title. Supports \n for newline (works in shell with $'line1\nline2' or when called from Python)
--xlabel, --ylabelAxis labels
--width N, --height NFigure size in inches
--show-valuesShow numeric labels on bars
--no-trendHide trend line (scatter)
--no-legendHide legend
--cmap NAMEColormap (heatmap)
--vmin, --vmaxValue range (heatmap)

Output

  • .png — 300 DPI raster (default)
  • .svg — Vector (pass .svg extension to --out)

When Agent Generates Figures (Not CLI)

If creating a figure via Python script rather than CLI:

  1. Always call detect_cjk_font() first if any label may contain CJK
  2. Use fontproperties=font_prop on all text-setting calls with CJK content
  3. Set plt.rcParams['axes.unicode_minus'] = False (prevents minus sign boxes)
  4. Verify output: file size > 20KB for multi-label charts indicates font loaded
  5. Preferred output: PNG at 300 DPI, bbox_inches='tight', white background

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Research

Polymarket Macro Asymmetric Longshot Trader

Systematically finds markets with huge asymmetric payoff -- markets priced at 2-10% where cross-category macro analysis suggests the REAL probability is 15-3...

Registry SourceRecently Updated
Research

Polymarket Science Milestones Trader

Trades Polymarket prediction markets on scientific breakthroughs, Nobel Prizes, physics discoveries, and research milestones. Corrects for systematic retail...

Registry SourceRecently Updated
2990Profile unavailable
Research

Tradealpha Realtime News

Fetch realtime TradeAlpha news across Reuters, Bloomberg, Truth Social, research alerts, and domestic news sources via `POST /api/v1/news/realtime_news`. Use...

Registry SourceRecently Updated
00Profile unavailable
Research

Max-Self-Improvement

MiniMax Agent self-evolution system with 5-layer memory for continuous learning, error analysis, and persistent personalized context management.

Registry SourceRecently Updated
00Profile unavailable