AI Agent Hub
Back to skills
Academic Figures Generator icon

Academic Figures Generator

Data Analysis Updated 2026.08.30

Paste the following prompt into your AI chat to install this skill:

Please install @user_481397b5/academic-figures by following the official guide at https://skillhub.cn/install/skillhub.md.

About this skill

Challenges in Academic Figure Preparation

Creating figures for scientific publications often involves meeting strict journal requirements, which can be time-consuming and error-prone. Key issues include:

  • Complex Journal Standards: Journals like Nature and Lancet mandate specific dimensions (e.g., 89mm single-column, 183mm double-column), DPI (600+), fonts (Helvetica 7pt, minimum 5pt), and colorblind-safe palettes. Manual adjustment of matplotlib code to comply is inefficient and prone to errors, such as setting column widths or colors incorrectly.
  • Lack of Data Validation: Invalid data structures can produce flawed outputs, delaying submissions. For example, mismatched series lengths or missing required keys may generate broken charts.
  • Accessibility Concerns: Traditional color schemes may not be suitable for colorblind readers, reducing the paper's accessibility and potentially leading to journal rejections.

Core Capabilities and Workflow

This tool addresses these challenges with a single command, offering the following features:

  • 14 Chart Types: Covers bar charts (-t bar), heatmaps (-t heatmap), forest plots (-t forest), KM survival curves (-t km), and more via the -t parameter, suitable for most academic analyses.
  • 7 Color Schemes: Includes glm (default, elegant and colorblind-safe) and okabe-ito (Nature Methods gold standard), switchable with --theme. For instance, --theme okabe-ito ensures colorblind safety for journal submissions.
  • Journal Presets: Parameters like --journal nature or --journal lancet automatically apply official column widths, fonts, and DPI (e.g., nature double-column at 183mm, 7pt font), eliminating manual configuration.
  • Data Validation and Verification:
  • Pre-run validate_data() checks data structure (e.g., box/violin labels must match group count), with fatal errors (e.g., empty series) returning exit code 1 without saving.
  • For PDF output, --verify performs pixel-level overlap checks to prevent label obscuration.
  • Chinese Language Support: --cjk auto-detects and loads Chinese fonts (e.g., Noto Sans CJK), recursively scanning data dictionary keys to avoid garbled text in bilingual charts.

Workflow: Users provide a JSON data file and run a command like python gen_figure.py -t bar --theme okabe-ito --journal nature -o figure.pdf. The tool executes data validation, color application, and layout adjustment, outputting a 600 DPI PDF that meets publication standards.

Important Considerations

  • Data Format Requirements: Input must be JSON with required keys for the chart type. For example, bar charts need series (data arrays) and labels; error bars require the errors field.
  • Journal Submission Tips: For submissions, use --theme okabe-ito and PDF output to comply with mainstream journal colorblind safety requirements. Avoid nature or lancet color schemes, as they are not colorblind-safe.
  • CJK Font Issues: The system must have Chinese fonts installed (e.g., Noto Sans CJK); otherwise, run setup_env.py for automatic detection and cache clearing. Custom fonts can be specified with --cjk-font.
  • Verification Process: Before delivering PDFs, run scripts/audit_pdf.py to check font sizes against journal minimums (e.g., nature 5pt) and use scripts/verify_overlap_pixel.py to verify no overlaps.
  • Scope Limits: This tool is focused on academic figure generation and is not suitable for medical illustrations (e.g., SVG) or terminal CLI charts, which require specialized tools. For flowcharts (-t diagram), avoid white blocks to ensure visibility on white backgrounds.

Use Cases

  • A biomedical researcher preparing a Nature paper submission needs to generate bar charts with one command that comply with double-column dimensions, font sizes, and colorblind-safe palettes, ensuring data validation passes before outputting 600 DPI PDF.
  • A clinical data analysis team writing a research paper needs to create KM survival curves including Log-rank tests, risk tables, and median survival annotations, using journal presets to meet Lancet formatting requirements.
  • An academic institution producing an annual report needs to batch-generate heatmaps and scatter plots with a unified color scheme and verify no label overlaps, ensuring all charts adhere to internal publication standards.
  • A research supervisor guiding students through thesis figures requires generating flowcharts to illustrate research designs, with Chinese label support to automatically load fonts and prevent garbled text.

Best For

  • Biomedical researcher: Needs to quickly convert experimental data into journal-compliant figures, avoiding manual adjustments of dimensions, fonts, and colors to save time on paper preparation.
  • Clinical data analyst: Responsible for generating statistical charts like survival analysis and ROC curves with professional annotations and outputting publication-grade PDFs to support clinical study report writing.
  • Academic publishing editor: Reviews author-submitted figures for journal guideline compliance, requiring tools to automatically apply column width and font presets and verify no overlaps to streamline the review process.
  • Research team lead: Manages visualization work across multiple projects, needing unified color schemes and format standards to avoid redundant configuration by team members and ensure figure consistency.