scientific-figure-pro
Scientific Figure Pro
Use this skill to create or revise publication figures with consistent aesthetics from the figures4papers project.
Workflow
- Identify the figure family (bar, trend, heatmap, scatter, multi-panel, conceptual illustration).
- Load helper APIs from
scripts/scientific_figure_pro.py. - Apply style first with
apply_publication_style(...). - Build the figure using
make_*helpers. - Export with
finalize_figure(...)to keep layout and output defaults consistent.
Use The Helper Module
Load by file path when package imports are inconvenient:
import importlib.util
from pathlib import Path
import matplotlib.pyplot as plt
module_path = Path("skills/scientific-figure-pro/scripts/scientific_figure_pro.py")
spec = importlib.util.spec_from_file_location("scientific_figure_pro", module_path)
mod = importlib.util.module_from_spec(spec)
spec.loader.exec_module(mod)
Core APIs
FigureStyle(...): Configure typography and axis linewidth.apply_publication_style(style=None): Apply global rcParams.create_subplots(nrows, ncols, figsize, **kwargs): Create flattened axes.make_grouped_bar(...): Build grouped bars with publication defaults.make_trend(...): Build trend lines with optional confidence shadow.make_heatmap(...): Build heatmaps with optional labels and annotations.make_scatter(...): Build clean scatter plots.make_sphere_illustration(...): Build conceptual shaded sphere panels.finalize_figure(fig, out_path, formats=None, dpi=300, pad=0.05): Save outputs consistently.
Style Policy
- Use Helvetica/Arial-like sans-serif families.
- Remove top/right spines.
- Keep legends frameless.
- Use semantic palette mapping:
- blue for target/proposed method,
- green for improvements,
- red for contrasts/baselines,
- neutral for support categories.
- Use
dpi=300by default anddpi=600for dense bar panels.
Practical Defaults
- Dense benchmark bars:
FigureStyle(font_size=24, axes_linewidth=3)and wide canvas. - Compact analysis charts:
FigureStyle(font_size=15 or 16, axes_linewidth=2). - Finalize every figure through
finalize_figure(...)instead of directplt.savefig(...).
Dependencies
- Python 3.8+
matplotlibnumpy
References
- Read
references/design_theory.mdwhen you need style rationale and reproduction rules.
More from l-yifan/skills
figures4papers-playbook
Locate and adapt real plotting examples from the figures4papers repository. Use when users ask for a figure in the style of specific papers/projects, want the closest existing script template, or need fast script selection by chart type/domain before customization.
30deep-wiki
Access AI-generated documentation and insights for GitHub repositories via DeepWiki. This skill should be used when exploring unfamiliar codebases, understanding repository architecture, finding implementation patterns, or asking questions about how a GitHub project works. Supports any public GitHub repository.
25gkg
Global Knowledge Graph for codebase analysis. This skill should be used when searching for code definitions (functions, classes, methods), finding references to symbols, understanding code structure, analyzing import usage, generating repository maps, or performing impact analysis before refactoring. Supports TypeScript, JavaScript, Python, Java, and more.
21gh-grep
Search real-world code examples across millions of GitHub repositories using grep.app. This skill should be used when looking for implementation patterns, API usage examples, library integration patterns, or production code references. Supports literal code search, regex patterns, and filtering by language/repo/path.
18github
Interact with GitHub repositories, issues, pull requests, and code via the GitHub MCP server. This skill should be used when managing repositories, creating/updating files, working with issues and PRs, searching code/repos/users, creating branches, and performing code reviews. Supports all major GitHub API operations.
16context7
Fetch up-to-date documentation and code examples for any library or framework. Use when needing API references, code examples, library documentation, or framework guides. Supports React, Next.js, MongoDB, Supabase, and thousands of other libraries.
13