Create and audit truthful, accessible, publication-ready scientific figures with Matplotlib, Seaborn, or Plotly. Use for figure design, multi-panel layouts, uncertainty and missing-data displays, color/contrast review, image metadata validation, and journal export planning.
Build figures that preserve scientific meaning before optimizing appearance. Separate universal principles from dated publisher rules, preserve raw data and transformations, use color redundantly, and inspect delivered files rather than trusting plotting defaults.
Non-negotiable guardrails
Never alter, hide, invent, or selectively enhance data to improve a figure.
Preserve raw tables/images, exclusions, missing-value codes, analysis code, normalization, binning, image adjustments, and random seeds.
Do not infer journal requirements. Identify the exact journal, article type, figure type, and submission phase; verify its live official guidance.
Do not claim that a palette, DPI value, format, or automated report makes a figure accessible or journal-compliant.
Do not silently connect missing observations, suppress inconvenient points, upsample images as if detail increased, or tune axes/dual axes to exaggerate a conclusion.
Keep interactive and static outputs as distinct deliverables. Interactive hover is not a substitute for labels, alt text, keyboard access, an accessible data table, or a static fallback.
Read references/publication_guidelines.md for deceptive-encoding and integrity checks. Read references/journal_requirements.md only after the target and phase are known.
Workflow
1. Define the evidence and destination
Record:
audience and medium: manuscript, web, slide, poster, supplement;
exact publisher/journal, article type, submission phase, and intended final width;
source-data paths/identifiers and output provenance.
If requirements are not known, create a provisional general figure and label all publisher choices as pending verification.
2. Choose an honest encoding
Prefer position on a common scale. Before coding, check:
Bars/areas: normally include zero because length/area is measured from a baseline.
Points/lines: nonzero limits can be valid; show context and disclose breaks.
Uncertainty: name SD, SE, CI, percentile, posterior, or another interval; state n and the unit of replication.
Raw observations: show them when feasible; do not let jitter obscure categories/values.
Missing data: distinguish missing, zero, censored, and excluded; use gaps or explicit model/interpolation styling.
Area/volume: scale area/volume, not radius/diameter; avoid decorative 3D.
Log axes: label the base/transform and declare how zero/negative values are handled.
Binning/smoothing: record edges, bandwidth/window, method, and sensitivity.
Normalization: state formula/reference and keep limits consistent across compared panels.
Dual axes: prefer aligned panels; if unavoidable, justify units and do not engineer apparent correlation.
Images: preserve originals, disclose whole-image adjustments, show scale bars, and avoid clipped/erased background.
3. Design accessibility in, not after
Use color plus marker, line style, hatching, direct label, or panel separation.
Choose qualitative, sequential, diverging, or cyclic color according to data semantics.
Audit foreground/background contrast at the rendered size.
Make missing and out-of-range values explicit.
Provide alt text, a longer description for complex figures, and underlying data for web delivery.
Treat WCAG 2.2 as web guidance: 4.5:1 normal text, 3:1 large text, and 3:1 for graphical objects required for understanding; color cannot be the only cue. Applicability and exceptions matter.
See references/color_palettes.md. A grayscale screen is useful but is not a complete color-vision or accessibility test.
4. Implement with scoped styles
Use Matplotlib's object-oriented API and temporary style contexts:
import matplotlib.pyplot as plt
from style_presets import style_context
with style_context("default", palette_name="okabe_ito_on_white"):
fig, ax = plt.subplots(
figsize=(89 / 25.4, 60 / 25.4),
layout="constrained",
)
ax.plot(x, y, marker="o", label="Observed")
ax.set(xlabel="Time (hours)", ylabel="Response (unit)")
ax.legend()
layout="constrained" supports colorbars, nested GridSpec, subfigures, and subplot_mosaic. Do not call tight_layout() afterward; it disables constrained layout.
For exact physical dimensions, do not use bbox_inches="tight" unless the changed page size is intentional.
Axes-level functions fit custom Matplotlib layouts; figure-level functions create their own figures/facets. Do not customize Seaborn's internal artist lists as if they were stable API.
Plotly
Use write_html() for interaction and write_image()/plotly.io.write_images() for static output.
Kaleido 1.3.0 requires Chrome/Chromium; it no longer bundles Chrome.
Current static formats: PNG, JPEG, WebP, SVG, PDF. EPS is Kaleido v0-only.
Do not pass deprecated engine= or use Orca/plotly.io.kaleido.scope.
width, height, and scale control pixels; scale=3 is not inherently “300 DPI.”
WebGL traces embed raster content in PDF/SVG.
Fully offline exports need local external assets when a figure references MathJax/topojson/tiles.
The exporter refuses implicit overwrite, writes atomically, keeps vector DPI for embedded rasters, uses TIFF LZW, and can use PDF/PS Type 42 fonts. It does not validate scientific content or publisher acceptance.
For editable fonts:
PDF/PS Type 42 embeds TrueType fonts.
svg.fonttype="none" keeps text editable/searchable but does not embed fonts; appearance depends on installed fonts.
svg.fonttype="path" preserves glyph appearance as paths but loses editable/searchable text.
Use an opaque explicit background unless transparency is required; blending against another background changes apparent contrast.
6. Inspect, compare, and review
Inspect file metadata.
Audit palette contrast/grayscale separation.
Compare against a dated publisher snapshot.
View at final size in the manuscript/web context.
Manually review fonts, embedded rasters, clipping, legends, scale bars, image integrity, caption, alt text, and source data.
Re-check the live target-journal page immediately before upload.
Pinned snapshot
The examples and smoke tests use direct package pins current on 2026-07-23:
This is a dated direct-dependency snapshot, not a transitive lock. Use the project's uv lock for exact replay; this skill intentionally ships no dependency lock.
Bundled CLIs
All helpers are deterministic, network-free, bounded, reject symlink inputs/destinations where relevant, and refuse overwrite unless --force is explicit.
Supports raster images (Pillow), SVG, PDF (pypdf), and EPS/PS. Reports dimensions, DPI/effective DPI, mode, alpha, ICC presence, compression, page size, and conservative first-page PDF font resources. It does not inspect every embedded raster in a vector container.
1---2name: scientific-visualization3description: "Create and audit truthful, accessible, publication-ready scientific figures with Matplotlib, Seaborn, or Plotly. Use for figure design, multi-panel layouts, uncertainty and missing-data displays, color/contrast review, image metadata validation, and journal export planning."4allowed-tools: "Read Write Edit Bash Glob Grep"5category: research-and-academic6source_repo: K-Dense-AI/scientific-agent-skills7source_path: "skills/scientific-visualization/SKILL.md"8source_url: https://github.com/K-Dense-AI/scientific-agent-skills/blob/HEAD/skills/scientific-visualization/SKILL.md9metadata:10 source: https://skillmd.com/skills/thedixitjain/scientific-visualization11---121314# Scientific Visualization1516Build figures that preserve scientific meaning before optimizing appearance. Separate universal principles from dated publisher rules, preserve raw data and transformations, use color redundantly, and inspect delivered files rather than trusting plotting defaults.1718## Non-negotiable guardrails1920- Never alter, hide, invent, or selectively enhance data to improve a figure.21- Preserve raw tables/images, exclusions, missing-value codes, analysis code, normalization, binning, image adjustments, and random seeds.22- Do not infer journal requirements. Identify the exact journal, article type, figure type, and submission phase; verify its live official guidance.23- Do not claim that a palette, DPI value, format, or automated report makes a figure accessible or journal-compliant.24- Do not silently connect missing observations, suppress inconvenient points, upsample images as if detail increased, or tune axes/dual axes to exaggerate a conclusion.25- Keep interactive and static outputs as distinct deliverables. Interactive hover is not a substitute for labels, alt text, keyboard access, an accessible data table, or a static fallback.2627Read `references/publication_guidelines.md` for deceptive-encoding and integrity checks. Read `references/journal_requirements.md` only after the target and phase are known.2829## Workflow3031### 1. Define the evidence and destination3233Record:3435- audience and medium: manuscript, web, slide, poster, supplement;36- exact publisher/journal, article type, submission phase, and intended final width;37- variable semantics, units, sample/replicate structure, missing/censored values;38- estimator and uncertainty definition;39- transformations: filtering, aggregation, normalization, smoothing, bins, image processing;40- source-data paths/identifiers and output provenance.4142If requirements are not known, create a provisional general figure and label all publisher choices as pending verification.4344### 2. Choose an honest encoding4546Prefer position on a common scale. Before coding, check:4748- **Bars/areas:** normally include zero because length/area is measured from a baseline.49- **Points/lines:** nonzero limits can be valid; show context and disclose breaks.50- **Uncertainty:** name SD, SE, CI, percentile, posterior, or another interval; state `n` and the unit of replication.51- **Raw observations:** show them when feasible; do not let jitter obscure categories/values.52- **Missing data:** distinguish missing, zero, censored, and excluded; use gaps or explicit model/interpolation styling.53- **Area/volume:** scale area/volume, not radius/diameter; avoid decorative 3D.54- **Log axes:** label the base/transform and declare how zero/negative values are handled.55- **Binning/smoothing:** record edges, bandwidth/window, method, and sensitivity.56- **Normalization:** state formula/reference and keep limits consistent across compared panels.57- **Dual axes:** prefer aligned panels; if unavoidable, justify units and do not engineer apparent correlation.58- **Images:** preserve originals, disclose whole-image adjustments, show scale bars, and avoid clipped/erased background.5960### 3. Design accessibility in, not after6162- Use color plus marker, line style, hatching, direct label, or panel separation.63- Choose qualitative, sequential, diverging, or cyclic color according to data semantics.64- Audit foreground/background contrast at the rendered size.65- Make missing and out-of-range values explicit.66- Provide alt text, a longer description for complex figures, and underlying data for web delivery.67- Treat WCAG 2.2 as web guidance: 4.5:1 normal text, 3:1 large text, and 3:1 for graphical objects required for understanding; color cannot be the only cue. Applicability and exceptions matter.6869See `references/color_palettes.md`. A grayscale screen is useful but is not a complete color-vision or accessibility test.7071### 4. Implement with scoped styles7273Use Matplotlib's object-oriented API and temporary style contexts:7475```python76import matplotlib.pyplot as plt7778from style_presets import style_context7980with style_context("default", palette_name="okabe_ito_on_white"):81 fig, ax = plt.subplots(82 figsize=(89 / 25.4, 60 / 25.4),83 layout="constrained",84 )85 ax.plot(x, y, marker="o", label="Observed")86 ax.set(xlabel="Time (hours)", ylabel="Response (unit)")87 ax.legend()88```8990`layout="constrained"` supports colorbars, nested GridSpec, subfigures, and `subplot_mosaic`. Do not call `tight_layout()` afterward; it disables constrained layout.9192For exact physical dimensions, do not use `bbox_inches="tight"` unless the changed page size is intentional.9394#### Color normalization9596```python97import matplotlib as mpl9899norm = mpl.colors.TwoSlopeNorm(vmin=-2, vcenter=0, vmax=5)100cmap = mpl.colormaps["RdBu_r"].with_extremes(bad="#777777")101image = ax.imshow(values, norm=norm, cmap=cmap, interpolation="nearest")102fig.colorbar(image, ax=ax, label="Change (unit)")103```104105Use `LogNorm`, `CenteredNorm`, `SymLogNorm`, `BoundaryNorm`, or `TwoSlopeNorm` only when its mapping matches the scientific meaning.106107#### Seaborn108109Seaborn 0.13.2 uses the current `errorbar` API:110111```python112sns.lineplot(113 data=frame,114 x="time",115 y="response",116 hue="treatment",117 style="treatment",118 markers=True,119 errorbar=("ci", 95),120 n_boot=5000,121 seed=20260723,122 ax=ax,123)124```125126Axes-level functions fit custom Matplotlib layouts; figure-level functions create their own figures/facets. Do not customize Seaborn's internal artist lists as if they were stable API.127128#### Plotly129130- Use `write_html()` for interaction and `write_image()`/`plotly.io.write_images()` for static output.131- Kaleido 1.3.0 requires Chrome/Chromium; it no longer bundles Chrome.132- Current static formats: PNG, JPEG, WebP, SVG, PDF. EPS is Kaleido v0-only.133- Do not pass deprecated `engine=` or use Orca/`plotly.io.kaleido.scope`.134- `width`, `height`, and `scale` control pixels; `scale=3` is not inherently “300 DPI.”135- WebGL traces embed raster content in PDF/SVG.136- Fully offline exports need local external assets when a figure references MathJax/topojson/tiles.137138### 5. Export explicitly and record provenance139140```python141from figure_export import export_figure142143report = export_figure(144 fig,145 "outputs/figure1",146 formats=["pdf", "png"],147 dpi=600,148 bbox_inches=None, # preserve figure page dimensions149 provenance={150 "raw_data": "data/source.csv",151 "transformations": ["predeclared QC filter", "group mean"],152 "uncertainty": "95% bootstrap CI; seed 20260723",153 "missing_data": "retained as gaps",154 },155 write_manifest=True,156)157```158159The exporter refuses implicit overwrite, writes atomically, keeps vector DPI for embedded rasters, uses TIFF LZW, and can use PDF/PS Type 42 fonts. It does not validate scientific content or publisher acceptance.160161For editable fonts:162163- PDF/PS Type 42 embeds TrueType fonts.164- `svg.fonttype="none"` keeps text editable/searchable but does not embed fonts; appearance depends on installed fonts.165- `svg.fonttype="path"` preserves glyph appearance as paths but loses editable/searchable text.166167Use an opaque explicit background unless transparency is required; blending against another background changes apparent contrast.168169### 6. Inspect, compare, and review1701711. Inspect file metadata.1722. Audit palette contrast/grayscale separation.1733. Compare against a dated publisher snapshot.1744. View at final size in the manuscript/web context.1755. Manually review fonts, embedded rasters, clipping, legends, scale bars, image integrity, caption, alt text, and source data.1766. Re-check the live target-journal page immediately before upload.177178## Pinned snapshot179180The examples and smoke tests use direct package pins current on 2026-07-23:181182```bash183uv run --isolated --no-project --python 3.13 \184 --with "matplotlib==3.11.1" \185 --with "seaborn==0.13.2" \186 --with "plotly==6.9.0" \187 --with "kaleido==1.3.0" \188 --with "pillow==12.3.0" \189 --with "pypdf==6.14.2" \190 python your_figure.py191```192193This is a dated direct-dependency snapshot, not a transitive lock. Use the project's uv lock for exact replay; this skill intentionally ships no dependency lock.194195## Bundled CLIs196197All helpers are deterministic, network-free, bounded, reject symlink inputs/destinations where relevant, and refuse overwrite unless `--force` is explicit.198199### Inspect raster/vector metadata200201```bash202uv run --isolated --no-project --python 3.13 \203 --with "pillow==12.3.0" \204 python scripts/image_metadata.py figure.tiff \205 --format tiff --mode RGB --min-dpi 300 --target-width-mm 85 \206 --alpha-policy forbid207```208209Supports raster images (Pillow), SVG, PDF (pypdf), and EPS/PS. Reports dimensions, DPI/effective DPI, mode, alpha, ICC presence, compression, page size, and conservative first-page PDF font resources. It does not inspect every embedded raster in a vector container.210211### Audit palette contrast and grayscale212213```bash214uv run --isolated --no-project --python 3.13 \215 python scripts/palette_audit.py \216 --palette okabe_ito_on_white \217 --background FFFFFF \218 --role graphical219```220221Reports exact WCAG sRGB contrast plus pairwise CIE L* grayscale screening. The grayscale threshold is a heuristic, not a standard.222223### Plan/screen publisher export224225```bash226uv run --isolated --no-project --python 3.13 \227 python scripts/export_plan.py \228 --publisher nature \229 --figure-type combination \230 --width single \231 --phase final232```233234Add `--input figure.pdf` to screen machine-readable properties. Profiles are official-source snapshots accessed 2026-07-23, not automatic compliance rules.235236### Preview styles237238```bash239uv run --isolated --no-project --python 3.13 \240 --with "matplotlib==3.11.1" \241 python scripts/style_preview.py \242 --output outputs/style-preview \243 --style default \244 --palette okabe_ito_on_white \245 --formats png,svg246```247248### Inspect/write styles and smoke-test export249250```bash251uv run --isolated --no-project --python 3.13 \252 python scripts/style_presets.py --list253uv run --isolated --no-project --python 3.13 \254 python scripts/style_presets.py --show nature255uv run --isolated --no-project --python 3.13 \256 --with "matplotlib==3.11.1" \257 python scripts/figure_export.py --demo outputs/export-smoke --manifest258```259260## Assets261262- `assets/publication.mplstyle`: general print starting point.263- `assets/nature.mplstyle`: dated flagship Nature visual starting point, not a compliance preset.264- `assets/presentation.mplstyle`: larger projected-display style.265- `assets/color_palettes.py`: importable Okabe-Ito and Paul Tol values with metadata.266- `assets/publisher_profiles.json`: dated, machine-readable planning snapshots.267268Matplotlib style files omit `#` in hex colors because `#` begins comments in `.mplstyle` parsing.269270## References271272- `references/publication_guidelines.md`: integrity, deceptive encodings, accessibility, static/interactive output.273- `references/color_palettes.md`: palette semantics, exact values, WCAG contrast, grayscale caveats, color management.274- `references/journal_requirements.md`: phase-specific official publisher snapshots.275- `references/matplotlib_examples.md`: current, runnable Matplotlib/Seaborn/Plotly patterns.276- `references/sources.md`: official URLs, dates, versions, and research basis.277278## Final review checklist279280- [ ] Raw data/images and transformation code are preserved.281- [ ] Missing values, exclusions, bins, normalization, and uncertainty are explicit.282- [ ] Baselines, scales, limits, and area/volume encodings are honest.283- [ ] Color is redundant and rendered contrast was reviewed.284- [ ] Figure has an accessible description/data alternative where applicable.285- [ ] Physical dimensions, DPI, format, fonts, transparency, and file size were inspected after export.286- [ ] Publisher rules were verified for the exact journal and phase.287- [ ] No automated report is presented as a scientific, accessibility, or compliance certification.288289---290291**Source:** [`K-Dense-AI/scientific-agent-skills`](https://github.com/K-Dense-AI/scientific-agent-skills) → `skills/scientific-visualization/SKILL.md`
Run npx get-skill add thedixitjain/scientific-visualization in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
Create and audit truthful, accessible, publication-ready scientific figures with Matplotlib, Seaborn, or Plotly. Use for figure design, multi-panel layouts, uncertainty and missing-data displays, color/contrast review, image metadata validation, and journal export planning. It is listed under Security on SkillMD.
This skill has not completed SkillMD's automated safety review yet. Independent scanners report: SkillSpector: PASS, Skill Scanner: PASS. Capability flags: executes scripts, makes network calls. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Yes. Installing skills from SkillMD is free, and the skill stays under its author's original license.
thedixitjain (@thedixitjain) published this skill. Their other Agent Skills are listed on their SkillMD profile.