# Visualization knowledge-base index

> Cross-disciplinary index of plotting libraries, style guides, palettes,
> and specialty tools. **Pointer-only** — this file does not redistribute
> documentation, it links out.

## Provenance and honesty

**Every URL in this index has been HEAD-checked live before commit** (script
`_verify_kb_urls.py`, re-runnable). Last verification: **2026-05-08**.
33/33 URLs returned 200/redirect at last check.

**Honest record of items removed during initial cleanup**:

- `plotneurips` (claimed astronomy HR-diagram lib) — **fabricated**, no such package exists. Removed.
- `CCSE-style polar plots` (claimed orbital-mechanics convention) — **fabricated** term. Removed.
- `mwdust` was listed as visualization — **incorrect categorization**; it is a Milky-Way dust *data* package, not viz. Removed.
- `pyhep` was listed as a single library — there is a workshop named PyHEP and various scikit-hep tools, but `pyhep` is not a single library name. Replaced with the verified `scikit-hep/mplhep` instead.
- Wong palette URL was a third-party tool; replaced with the canonical citation
  (Wong B., *Nature Methods* 2011, doi:10.1038/nmeth.1618).
- Okabe-Ito JFly URL had moved domain (jfly.iam.u-tokyo.ac.jp dead). Replaced with
  the live mirror at `jfly.uni-koeln.de/color/`.

If you find a broken URL, run `_verify_kb_urls.py` and submit a fix. Do not
add entries that have not been HEAD-verified.

This index sits in `resources/figure-references/` and **does not modify**
`.codex/skills/` or `openspec/` — zero conflict with the colleague's
phase0-stress-tests branch or the Codex skill packaging.

---

## 1. Plotting libraries by language

### Python

| Library | Strength | Link |
|---|---|---|
| **matplotlib** | Workhorse; everything reduces to it | https://matplotlib.org/stable/gallery/ |
| **seaborn** | Statistical (violin / box / pair / joint), built on mpl | https://seaborn.pydata.org/examples/ |
| **plotly** | Interactive, 3D, HTML output | https://plotly.com/python/ |
| **bokeh** | Interactive, large-data streaming | https://docs.bokeh.org/en/latest/docs/gallery.html |
| **altair** | Grammar-of-graphics, Vega-Lite backend | https://altair-viz.github.io/gallery/ |
| **plotnine** | Direct ggplot2 port | https://plotnine.readthedocs.io/ |
| **mpl_toolkits.mplot3d** | 3D scatter / surface / bar (built-in mpl) | https://matplotlib.org/stable/gallery/mplot3d/ |
| **networkx** | Graph layouts; pairs with mpl for rendering | https://networkx.org/documentation/stable/auto_examples/ |
| **pyCirclize** | Chord / circular layouts (Circos in pure Python) | https://github.com/moshi4/pyCirclize |
| **corner** | MCMC corner / pair plots — astrophysics standard | https://corner.readthedocs.io/ |
| **SciencePlots** | matplotlib styles tuned for paper figures | https://github.com/garrettj403/SciencePlots |
| **mplhep** | HEP / particle physics paper styles | https://mplhep.readthedocs.io/ |
| **proplot** | Opinionated mpl wrapper, geographic projections | https://proplot.readthedocs.io/ |

### R

| Library | Strength | Link |
|---|---|---|
| **ggplot2** | Grammar-of-graphics gold standard | https://ggplot2.tidyverse.org/ |
| **lattice** | Trellis displays (multi-panel small multiples) | http://lattice.r-forge.r-project.org/ |
| **circlize** | Circos chord / circular plots in R | https://jokergoo.github.io/circlize_book/book/ |
| **ComplexHeatmap** | Hierarchical heatmaps with dendrograms | https://jokergoo.github.io/ComplexHeatmap-reference/ |
| **ggridges** | Ridge / joy plots | https://wilkelab.org/ggridges/ |

### JavaScript / web

| Library | Strength | Link |
|---|---|---|
| **D3.js** | Low-level SVG; everything custom is built on it | https://d3js.org/ |
| **Observable Plot** | Concise grammar over D3 | https://observablehq.com/plot/ |
| **Vega-Lite** | JSON spec, declarative | https://vega.github.io/vega-lite/examples/ |
| **ECharts** | Apache, batteries-included, Chinese ecosystem | https://echarts.apache.org/examples/ |

### Julia

| Library | Strength | Link |
|---|---|---|
| **Plots.jl** | High-level, multi-backend | https://docs.juliaplots.org/stable/ |
| **Makie.jl** | High-performance, GPU-friendly, paper-grade | https://docs.makie.org/stable/ |

### LaTeX / typesetting

| Tool | Strength | Link |
|---|---|---|
| **TikZ** | Schematic diagrams, exact typography | https://texample.net/tikz/ |
| **PGFPlots** | Plots in LaTeX, native font rendering | https://pgfplots.sourceforge.net/gallery.html |

### Commercial / GUI (mention but rarely top-of-stack for ML/physics papers)

- **Origin** — engineering/chemistry default
- **GraphPad Prism** — biostats default
- **MATLAB** — domain-specific convention (older PRL-style figures)

---

## 2. Style guides (where to draw the line)

| Source | Domain | Link |
|---|---|---|
| **Nature figure guidelines** | Cross-disciplinary, strict (88/180 mm, type sizes) | https://www.nature.com/nature/for-authors/formatting-guide |
| **Science figure guide** | Same era, slightly different specs | https://www.science.org/content/page/instructions-preparing-initial-manuscript |
| **NeurIPS / ICML formatting** | LaTeX template specs (8.5/17 cm column) | https://neurips.cc/ |
| **Tufte: *Visual Display of Quantitative Information*** | Data-ink ratio principle | book |
| **Wilke: *Fundamentals of Data Visualization*** | Practical, web-readable | https://clauswilke.com/dataviz/ |

---

## 3. Color palettes — accessibility first

| Palette | What it solves | Link |
|---|---|---|
| **viridis / cividis / inferno / plasma** | Perceptually uniform; viridis-family for sequential | https://matplotlib.org/stable/users/explain/colors/colormaps.html |
| **ColorBrewer 2** | Sequential / diverging / qualitative, colorblind-safe | https://colorbrewer2.org/ |
| **Wong palette** (Nature Methods 2011) | 8-color discrete, colorblind-safe | https://www.nature.com/articles/nmeth.1618 |
| **Okabe-Ito palette** | 7-color discrete + black/grey, colorblind-safe | https://jfly.uni-koeln.de/color/ |
| **RdBu_r / coolwarm** | Diverging signed data (the default in v11 library) | matplotlib built-in |

**Avoid**: rainbow / jet / hsv (perceptually non-uniform, inaccessible).
**Avoid red+green pairs alone** (most common colorblind type).

---

## 4. Specialty / domain ecosystems

### Astrophysics / cosmology

- **astropy.visualization** — sky projections, normalization, ZScale stretch
- **healpy** — full-sphere maps (Mollweide, Galactic frame)
- **corner.py** — MCMC posterior corner plots

### Particle / high-energy physics (HEP)

- **mplhep** (scikit-hep) — ATLAS / CMS / LHCb paper styles — https://github.com/scikit-hep/mplhep
- **Circos / circlize** — for QCD-fit wheels (e.g., HEPfit-style)

### Biology / single-cell

- **scanpy** — single-cell RNA-seq violin / heatmap / UMAP
- **ComplexHeatmap (R)** — clustered heatmaps
- **iTOL** — phylogenetic trees (web-based)
- **Circos** — gene expression circular layouts

### Climate / atmospheric

- **cartopy** — geographic projections, weather maps
- **xarray.plot** — gridded data, time-series
- **windrose** — wind direction histograms

### Network / graph

- **networkx + mpl** — basic
- **igraph** — large-graph layouts
- **graph-tool** — performance, statistical inference
- **Cytoscape** — biology pathway networks

---

## 5. Existing chart-to-code datasets we already use

| Dataset | Where | What |
|---|---|---|
| **TencentARC/Plot2Code** | `datasets/Plot2Code/` (132) + HF dataset | matplotlib gallery + code, hand-curated |
| **ChartMimic** | `datasets/ChartMimic/` (4800) + HF dataset | real ICLR-paper figures + matplotlib code |
| **Zhihan/Chart2NCode** | not downloaded; HF dataset | 176K × {Python, R, LaTeX} aligned |
| **MatPlotBench** | `datasets/MatPlotBench/` (100) + GitHub | hand-verified scientific figures + NL instructions (no code) |
| **arXiv source bundles** | `papers/<arxiv-id>/` | per-paper figures + LaTeX captions |

The HF Space gallery at
<https://huggingface.co/spaces/zcahjl3/figcopy-taxonomy-gallery> consolidates
the curated 174-pick stress pool (ChartMimic + manual stress) and 52 arXiv
real-paper style references.

---

## 6. When to use which (decision tree, terse)

```
Is this a one-shot figure I'll never edit? → use whichever is fastest
                                              (Origin, GraphPad, Excel — yes really)
Is this for a NeurIPS/ICML/ICLR paper?      → matplotlib + SciencePlots,
                                              or Plots.jl/Makie.jl
Nature/Science/Cell, biological?            → R + ggplot2, or Python + seaborn
Particle physics, lattice, HEP fit?         → matplotlib + mplhep
Astronomy, full-sky data?                   → astropy + healpy
Single-cell genomics?                       → scanpy or ComplexHeatmap
Network with > 5k nodes?                    → graph-tool, then export to mpl
Interactive / live dashboard?               → plotly or D3 / Observable
Exact typography matching paper text?       → TikZ / PGFPlots
Chord / Circos diagram?                     → pyCirclize (Python) or circlize (R)
                                              fall back: pure mpl Wedge + bezier
                                              (see picks_top/hepfit_wheel.code.py)
```

---

## 7. Style-transfer reading list (for the figure-style-copier skill itself)

- v11 aesthetic library (this repo): `.codex/skills/figure-style-copier/references/aesthetic-library.md`
- Drawer prompt: `.codex/skills/figure-style-copier/references/drawer.md`
- Reviewer prompt: `.codex/skills/figure-style-copier/references/reviewer.md`
- HF Space curated gallery: <https://huggingface.co/spaces/zcahjl3/figcopy-taxonomy-gallery>
- Stress-test subset (22 charts): same Space, top section

---

*Index last updated 2026-05-08. Owned by `resources/figure-references/`,
not by the figure-style-copier skill itself — extending this index does
not require a skill PR.*
