Skip to content

Yilin399/science-plotting-skill

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Science Plotting Skill

A Codex skill for producing publication-style scientific figures from CSV, TSV, or Excel data.

It focuses on clean Science/Nature-inspired plots for papers, academic reports, and talks:

  • multi-series line curves
  • marker line charts
  • mean bar charts with error bars and optional raw points
  • histograms with normal or lognormal fit curves
  • scatter plots with optional regression lines and equations
  • low-saturation science-muted default palette
  • compact, borderless legends with automatic best placement
  • SVG/PDF-first export with high-DPI PNG previews

Repository Layout

skills/science-plotting/
  SKILL.md
  agents/openai.yaml
  scripts/
  references/
  assets/
tests/smoke_test.py
requirements.txt

Install

Copy the skill folder into your Codex skills directory:

mkdir -p ~/.codex/skills
cp -r skills/science-plotting ~/.codex/skills/

On Windows PowerShell:

New-Item -ItemType Directory -Force $env:USERPROFILE\.codex\skills
Copy-Item -Recurse .\skills\science-plotting $env:USERPROFILE\.codex\skills\

Install plotting dependencies if you want to run the bundled scripts directly:

python -m pip install -r requirements.txt

Python 3.8 or newer is recommended. The dependency range keeps compatibility with Python 3.8 while still working on newer Python versions used by GitHub Actions.

Quick Examples

Line plot:

python skills/science-plotting/scripts/plot_science_curves.py \
  docs/data/nasa-gistemp-global-annual.csv \
  --x Year \
  --ycols "Annual anomaly" "5-year mean" \
  --ylabel "Temperature anomaly (deg C)" \
  --output figure.svg \
  --png figure.png

Bar chart with raw points:

python skills/science-plotting/scripts/plot_science_stat.py \
  docs/data/palmer-penguins-body-mass-bar.csv \
  --kind bar \
  --x species \
  --y body_mass_g \
  --hue sex \
  --error sem \
  --points \
  --ylabel "Body mass (g)" \
  --output bar.svg \
  --png bar.png

Bar chart with error bars only:

python skills/science-plotting/scripts/plot_science_stat.py \
  docs/data/palmer-penguins-body-mass-bar.csv \
  --kind bar \
  --x species \
  --y body_mass_g \
  --hue sex \
  --error sd \
  --ylabel "Body mass (g)" \
  --output bar-errorbar.svg \
  --png bar-errorbar.png

Histogram with fit:

python skills/science-plotting/scripts/plot_science_stat.py \
  docs/data/palmer-penguins-body-mass-hist.csv \
  --kind hist \
  --x value \
  --fit normal \
  --density \
  --xlabel "Body mass (g)" \
  --ylabel Density \
  --output hist.svg \
  --png hist.png

Scatter with regression:

python skills/science-plotting/scripts/plot_science_stat.py \
  docs/data/palmer-penguins-flipper-body-scatter.csv \
  --kind scatter \
  --x flipper_length_mm \
  --y body_mass_g \
  --regression \
  --equation \
  --corr \
  --scatter-label Data \
  --xlabel "Flipper length (mm)" \
  --ylabel "Body mass (g)" \
  --output scatter.svg \
  --png scatter.png

Data Formats

See skills/science-plotting/references/data-format.md for supported wide, long, bar, histogram, scatter, and Excel formats.

Validation

Run the smoke test:

python tests/smoke_test.py

The smoke test compiles both scripts and renders representative line, bar, histogram, and scatter figures into a temporary directory.

Notes

  • Excel files require pandas and openpyxl.
  • The default palette is science-muted; use --palette <name> to choose another palette.
  • Bar charts support --error sem, --error sd, and --error none; add --points when raw replicates should be visible.
  • Legends default to best and have no border.
  • Use vector output (.svg or .pdf) for manuscripts and PNG for preview.

Preview

Global temperature anomaly line plot:

NASA GISTEMP global temperature anomaly line plot

Grouped bar chart with raw points:

Palmer penguins body mass bar chart

Grouped bar chart with error bars only:

Palmer penguins body mass error-bar chart

Histogram with fitted curve:

Palmer penguins body mass histogram

Scatter plot with fitted line:

Palmer penguins flipper length and body mass scatter plot

Example Data Sources

Release Checklist

Before publishing a GitHub release:

python tests/smoke_test.py
git status --short
git add .
git commit -m "Release v0.1.0"
git tag -a v0.1.0 -m "Initial science-plotting skill release"
git push origin main
git push origin v0.1.0

Use semantic versioning:

  • v0.1.0 for the first public release
  • v0.1.1 for bug fixes
  • v0.2.0 for new chart types or visible behavior changes
  • v1.0.0 once the API and visual defaults feel stable

About

Science-style academic plotting skill for line charts, bar charts, histograms, and scatter plots from CSV or Excel data.

Topics

Resources

License

Stars

1 star

Watchers

0 watching

Forks

Contributors

Languages