CommunityImagegithub.com

earthsci-figures

Publication-grade scientific figures, multi-panel data plots in R (ggplot2 + patchwork), and local-to-regional 2D conceptual cross-sections & 3D oblique block diagrams in pure SVG (Python svg_engine.py) for Earth & Environmental Sciences: Climate & Cryosphere, Sedimentology & Stratigraphy, Igneous Petrology & Volcanology, Ecology & Environmental Science, and Hydrology & Hydrogeology. Use whenever creating, auditing, or polishing journal-ready figures (Nature, Nature Geoscience, Nature Water, Nature Communications) or 2D/3D geological and environmental block models.

What is earthsci-figures?

earthsci-figures is a Claude Code agent skill that publication-grade scientific figures, multi-panel data plots in R (ggplot2 + patchwork), and local-to-regional 2D conceptual cross-sections & 3D oblique block diagrams in pure SVG (Python svg_engine.py) for Earth & Environmental Sciences: Climate & Cryosphere, Sedimentology & Stratigraphy, Igneous Petrology & Volcanology, Ecology & Environmental Science, and Hydrology & Hydrogeology. Use whenever creating, auditing, or polishing journal-ready figures (Nature, Nature Geoscience, Nature Water, Nature Communications) or 2D/3D geological and environmental block models.

Works with~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/williamjot/earthsci-figures/tree/HEAD/skill/earthsci-figures

Installed? Explore more Image skills: steipete/songsee, affaan-m/frontend-design, mattpocock/improve-codebase-architecture · View all 6 →

Ask in your favorite AI

Open a new chat with this agent skill pre-loaded.

Documentation

Earth & Environmental Sciences Publication Figures & 2D/3D Models (earthsci-figures)

An open-source hybrid R + Python SVG skill and code library for producing submission-grade quantitative figures (ggplot2 + patchwork) alongside local-to-regional 2D conceptual models and 3D oblique block diagrams (pure vector SVG with native gradients, USGS <pattern> fills, shaded relief, translucent water, numbered badges, and zoom insets) across Earth & Environmental Sciences.

Distilled from publication standards in Nature, Nature Geoscience, Nature Water, Nature Climate Change, and Nature Communications.

Read the modular references when needed:

  • references/visual-grammar.md — Nature-family R typography, four-sided inward ticks, palettes, and export bundle.
  • references/schematics-2d-3d.md — Pure SVG 2D/3D block engine (python/svg_engine.py), projection math, USGS <pattern> fills, callouts, and insets.
  • references/domain-conventions.md — Conventions for Climate/Cryosphere, Sedimentology/Stratigraphy, Igneous Petrology, Ecology/Environmental Science, and Hydrology/Hydrogeology.

1. Dual-Engine Architecture

EngineBest ForKey FilesOutputs
R (ggplot2 + patchwork)Quantitative multi-panel data figures, statistics, chemostratigraphy, spatial fields, time series, TAS/REE/EPMA, hydrographsR/style_earthsci.R, R/schematics_helpers.REditable .svg (Arial), vector .pdf, optional 600-dpi .tiff, 300-dpi _preview.png, *_source_*.csv
Python Vector SVG (svg_engine.py)Local-to-regional 2D cross-sections and 3D oblique block diagrams with gradients, translucent water, USGS <pattern> fills, numbered badges, legends & zoom insetspython/svg_engine.pyEditable .svg (mm print units, Arial text) + 300/600-dpi .png via R::magick

2. Mandatory Figure Contract (Draft Before Coding)

Core claim:           One quantitative sentence with a verb and a number
Discipline:           Climate-Cryosphere / Sedimentology-Stratigraphy / Igneous-Petrology /
                      Ecology-Environmental / Hydrology-Hydrogeology
Figure suite:         Quantitative R figure + 2D conceptual cross-section (SVG) + 3D block diagram (SVG)
Target journal/size:  e.g., Nature Geoscience double-column (183 × 104–124 mm)
Panel / model map:    What unique question each panel or diagram answers
Uncertainty & stats:  AR(1) n_eff, BH-FDR α, replicate-level display, 95% CI / IQR, U-Pb / EPMA σ
Source data exports:  *_source_*.csv for every quantitative panel
Reviewer risk:        Top 2 methodological or visual objections a peer reviewer could raise

Non-Negotiable Integrity Rules

  1. Compute from rawest data. Never hardcode summary numbers disconnected from the reproducible script.
  2. Never disguise schematics as measured data. Explicitly mark 2D/3D conceptual models as "Conceptual model (not to scale)".
  3. Zero sloppy stratigraphic geometry. Stratigraphic columns use strictly rectangular beds (horizontal contacts + perpendicular grain-size steps; wavy lines reserved strictly for scoured erosional surfaces such as SB) — never cartoonish diagonally sloped wedges.
  4. Honest uncertainty always. Account for autocorrelation (trend_neff()), field multiplicity (fdr_mask()), and plot individual replicates behind summary means/medians.
  5. Mandatory Visual QA (300 dpi). Open every rendered *_preview.png (R and SVG alike) and eliminate every overlap of text on points, curves, arrows, polygons, or panel frames before delivering.

3. Standard Workflow (5 Steps)

  1. Runtime check: verify Rscript (ggplot2, patchwork, dplyr, tidyr, tibble, scales, viridisLite, RColorBrewer, svglite, ragg, magick) and Python (numpy, scipy).
  2. Write the Figure Contract (Section 2) and check references/domain-conventions.md.
  3. Build the quantitative R figure using source("R/style_earthsci.R") and export *_source_*.csv + .svg/.pdf/_preview.png.
  4. Build the local-to-regional 2D & 3D SVG models using from svg_engine import SVG, Block3D, pchip with CLI targets (2d | 3d | all).
  5. Inspect every *_preview.png pixel-by-pixel; adjust coordinates and re-render until zero label collisions remain.

Related Skills